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

Method BinaryKey

api/src/main/java/io/grpc/Metadata.java:863–872  ·  view source on GitHub ↗

Keys have a name and a binary marshaller used for serialization.

(String name, BinaryMarshaller<T> marshaller)

Source from the content-addressed store, hash-verified

861
862 /** Keys have a name and a binary marshaller used for serialization. */
863 private BinaryKey(String name, BinaryMarshaller<T> marshaller) {
864 super(name, false /* not pseudo */, marshaller);
865 checkArgument(
866 name.endsWith(BINARY_HEADER_SUFFIX),
867 "Binary header is named %s. It must end with %s",
868 name,
869 BINARY_HEADER_SUFFIX);
870 checkArgument(name.length() > BINARY_HEADER_SUFFIX.length(), "empty key name");
871 this.marshaller = checkNotNull(marshaller, "marshaller is null");
872 }
873
874 @Override
875 byte[] toBytes(T value) {

Callers

nothing calls this directly

Calls 2

checkNotNullMethod · 0.80
endsWithMethod · 0.45

Tested by

no test coverage detected