T - the type this codec supportspublic interface ThriftCodec<T>
A single type codec for reading and writing in Thrift format. Each codec is symmetric and therefore only supports a single concrete type.
Implementations of this interface are expected to be thread safe.
| Modifier and Type | Method and Description |
|---|---|
ThriftType |
getType()
The Thrift type this codec supports.
|
default boolean |
isNull(T value)
If the value is effectively null and should not be written.
|
T |
read(TProtocolReader protocol)
Reads a value from supplied Thrift protocol reader.
|
void |
write(T value,
TProtocolWriter protocol)
Writes a value to the supplied Thrift protocol writer.
|
ThriftType getType()
T read(TProtocolReader protocol) throws Exception
protocol - the protocol to read fromException - if any problems occurred when reading or coercing the valuevoid write(T value, TProtocolWriter protocol) throws Exception
value - the value to write; not nullprotocol - the protocol to write toException - if any problems occurred when writing or coercing the valuedefault boolean isNull(T value)
value - the value to testCopyright © 2012–2018. All rights reserved.