Package io.grpc
Class Metadata.LazyStreamBinaryKey<T>
- java.lang.Object
-
- io.grpc.Metadata.Key<T>
-
- io.grpc.Metadata.LazyStreamBinaryKey<T>
-
- Enclosing class:
- Metadata
private static class Metadata.LazyStreamBinaryKey<T> extends Metadata.Key<T>
A binary key for values which should be serialized lazily toInputStream
s.
-
-
Field Summary
Fields Modifier and Type Field Description private Metadata.BinaryStreamMarshaller<T>
marshaller
-
Constructor Summary
Constructors Modifier Constructor Description private
LazyStreamBinaryKey(java.lang.String name, Metadata.BinaryStreamMarshaller<T> marshaller)
Keys have a name and a stream 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) boolean
serializesToStreams()
Returns whether this key will be serialized to bytes lazily.(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, toString
-
-
-
-
Field Detail
-
marshaller
private final Metadata.BinaryStreamMarshaller<T> marshaller
-
-
Constructor Detail
-
LazyStreamBinaryKey
private LazyStreamBinaryKey(java.lang.String name, Metadata.BinaryStreamMarshaller<T> marshaller)
Keys have a name and a stream 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
-
serializesToStreams
boolean serializesToStreams()
Description copied from class:Metadata.Key
Returns whether this key will be serialized to bytes lazily.- Overrides:
serializesToStreams
in classMetadata.Key<T>
-
-