MCPcopy Create free account
hub / github.com/grpc/grpc-java / Key

Class Key

api/src/main/java/io/grpc/NameResolver.java:714–738  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected