Class ShortThriftCodec

java.lang.Object
io.airlift.drift.codec.internal.builtin.ShortThriftCodec
All Implemented Interfaces:
ThriftCodec<Short>

@Immutable public class ShortThriftCodec extends Object implements ThriftCodec<Short>
  • Constructor Details

    • ShortThriftCodec

      public ShortThriftCodec()
  • Method Details

    • getType

      public ThriftType getType()
      Description copied from interface: ThriftCodec
      The Thrift type this codec supports. The Thrift type contains the Java generic Type of the codec.
      Specified by:
      getType in interface ThriftCodec<Short>
    • read

      public Short read(TProtocolReader protocol) throws Exception
      Description copied from interface: ThriftCodec
      Reads a value from supplied Thrift protocol reader.
      Specified by:
      read in interface ThriftCodec<Short>
      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

      public void write(Short value, TProtocolWriter protocol) throws Exception
      Description copied from interface: ThriftCodec
      Writes a value to the supplied Thrift protocol writer.
      Specified by:
      write in interface ThriftCodec<Short>
      Parameters:
      value - the value to write; not null
      protocol - the protocol to write to
      Throws:
      Exception - if any problems occurred when writing or coercing the value