Package io.airlift.drift.codec
Class DelegateCodec<T>
java.lang.Object
io.airlift.drift.codec.DelegateCodec<T>
- All Implemented Interfaces:
ThriftCodec<T>
A placeholder for a
ThriftCodec that defers computation of the real codec
until it is actually used, and then just delegates to that codec.
This is used to break the cycle when computing the codec for a recursive type tries to compute codecs for all of its fields.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetType()The Thrift type this codec supports.read(TProtocolReader protocol) Reads a value from supplied Thrift protocol reader.voidwrite(T value, TProtocolWriter protocol) Writes a value to the supplied Thrift protocol writer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.airlift.drift.codec.ThriftCodec
isNull
-
Constructor Details
-
DelegateCodec
-
-
Method Details
-
getType
Description copied from interface:ThriftCodecThe Thrift type this codec supports. The Thrift type contains the Java generic Type of the codec.- Specified by:
getTypein interfaceThriftCodec<T>
-
read
Description copied from interface:ThriftCodecReads a value from supplied Thrift protocol reader.- Specified by:
readin interfaceThriftCodec<T>- Parameters:
protocol- the protocol to read from- Returns:
- the value; not null
- Throws:
Exception- if any problems occurred when reading or coercing the value
-
write
Description copied from interface:ThriftCodecWrites a value to the supplied Thrift protocol writer.- Specified by:
writein interfaceThriftCodec<T>- Parameters:
value- the value to write; not nullprotocol- the protocol to write to- Throws:
Exception- if any problems occurred when writing or coercing the value
-