Identifies an externally-defined custom argument that can be stored in Args. Uses reference equality so keys should be defined as global constants. @param type of values that can be stored under this key
| 712 | * @param <T> type of values that can be stored under this key |
| 713 | */ |
| 714 | @Immutable |
| 715 | @SuppressWarnings("UnusedTypeParameter") |
| 716 | public static final class Key<T> { |
| 717 | private final String debugString; |
| 718 | |
| 719 | private Key(String debugString) { |
| 720 | this.debugString = debugString; |
| 721 | } |
| 722 | |
| 723 | @Override |
| 724 | public String toString() { |
| 725 | return debugString; |
| 726 | } |
| 727 | |
| 728 | /** |
| 729 | * Creates a new instance of {@link Key}. |
| 730 | * |
| 731 | * @param debugString a string used to describe the key, used for debugging. |
| 732 | * @param <T> Key type |
| 733 | * @return a new instance of Key |
| 734 | */ |
| 735 | public static <T> Key<T> create(String debugString) { |
| 736 | return new Key<>(debugString); |
| 737 | } |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected