Class OptionalIntThriftCodec

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

@Immutable public class OptionalIntThriftCodec extends Object implements ThriftCodec<OptionalInt>
  • Constructor Details

    • OptionalIntThriftCodec

      public OptionalIntThriftCodec()
  • 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<OptionalInt>
    • read

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

      public boolean isNull(OptionalInt value)
      Description copied from interface: ThriftCodec
      If the value is effectively null and should not be written.
      Specified by:
      isNull in interface ThriftCodec<OptionalInt>
      Parameters:
      value - the value to test
      Returns:
      true if the value should not be written