Class CoercionThriftCodec<T>
java.lang.Object
io.airlift.drift.codec.internal.coercion.CoercionThriftCodec<T>
- All Implemented Interfaces:
ThriftCodec<T>
CoercionThriftCodec encapsulates a ThriftCodec and coerces the values to another type using
the supplied ThriftCoercion.
-
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 javaValue, 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
-
CoercionThriftCodec
-
-
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:
javaValue- the value to write; not nullprotocol- the protocol to write to- Throws:
Exception- if any problems occurred when writing or coercing the value
-