Package io.airlift.drift.codec.internal
Class EnumThriftCodec<T extends Enum<T>>
java.lang.Object
io.airlift.drift.codec.internal.EnumThriftCodec<T>
- All Implemented Interfaces:
ThriftCodec<T>
EnumThriftCodec is a codec for Java enum types. An enum is encoded as an I32 in Thrift, and this
class handles converting this vale to a Java enum constant.
-
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 enumConstant, 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
-
EnumThriftCodec
-
-
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 extends Enum<T>>
-
read
Description copied from interface:ThriftCodecReads a value from supplied Thrift protocol reader. -
write
Description copied from interface:ThriftCodecWrites a value to the supplied Thrift protocol writer.
-