Package io.grpc
Class Metadata.BinaryKey<T>
- java.lang.Object
-
- io.grpc.Metadata.Key<T>
-
- io.grpc.Metadata.BinaryKey<T>
-
- Enclosing class:
- Metadata
private static class Metadata.BinaryKey<T> extends Metadata.Key<T>
-
-
Field Summary
Fields Modifier and Type Field Description private Metadata.BinaryMarshaller<T>
marshaller
-
Constructor Summary
Constructors Modifier Constructor Description private
BinaryKey(java.lang.String name, Metadata.BinaryMarshaller<T> marshaller)
Keys have a name and a binary marshaller used for serialization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) T
parseBytes(byte[] serialized)
Parse a serialized metadata value from bytes.(package private) byte[]
toBytes(T value)
Serialize a metadata value to bytes.-
Methods inherited from class io.grpc.Metadata.Key
asciiName, equals, getMarshaller, hashCode, name, of, of, of, of, of, originalName, serializesToStreams, toString
-
-
-
-
Field Detail
-
marshaller
private final Metadata.BinaryMarshaller<T> marshaller
-
-
Constructor Detail
-
BinaryKey
private BinaryKey(java.lang.String name, Metadata.BinaryMarshaller<T> marshaller)
Keys have a name and a binary marshaller used for serialization.
-
-
Method Detail
-
toBytes
byte[] toBytes(T value)
Description copied from class:Metadata.Key
Serialize a metadata value to bytes.- Specified by:
toBytes
in classMetadata.Key<T>
- Parameters:
value
- to serialize- Returns:
- serialized version of value
-
parseBytes
T parseBytes(byte[] serialized)
Description copied from class:Metadata.Key
Parse a serialized metadata value from bytes.- Specified by:
parseBytes
in classMetadata.Key<T>
- Parameters:
serialized
- value of metadata to parse- Returns:
- a parsed instance of type T
-
-