Package io.grpc
Interface Metadata.AsciiMarshaller<T>
-
- Enclosing class:
- Metadata
public static interface Metadata.AsciiMarshaller<T>Marshaller for metadata values that are serialized into ASCII strings. The strings contain only following characters:- Space:
0x20, but must not be at the beginning or at the end of the value. Leading or trailing whitespace may not be preserved. - ASCII visible characters (
0x21-0x7E).
Note this has to be the subset of valid characters in
field-contentfrom RFC 7230 Section 3.2.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TparseAsciiString(java.lang.String serialized)Parse a serialized metadata value from an ASCII string.java.lang.StringtoAsciiString(T value)Serialize a metadata value to a ASCII string that contains only the characters listed in the class comment ofMetadata.AsciiMarshaller.
-
-
-
Method Detail
-
toAsciiString
java.lang.String toAsciiString(T value)
Serialize a metadata value to a ASCII string that contains only the characters listed in the class comment ofMetadata.AsciiMarshaller. Otherwise the output may be considered invalid and discarded by the transport, or the call may fail.- Parameters:
value- to serialize- Returns:
- serialized version of value, or null if value cannot be transmitted.
-
parseAsciiString
T parseAsciiString(java.lang.String serialized)
Parse a serialized metadata value from an ASCII string.- Parameters:
serialized- value of metadata to parse- Returns:
- a parsed instance of type T
-
-