Interface RowDecoder

All Known Implementing Classes:
BinaryRowDecoder, TextRowDecoder

public interface RowDecoder
Row decoder interface
  • Method Details

    • wasNull

      boolean wasNull(byte[] nullBitmap, MutableInt fieldIndex, MutableInt fieldLength)
      Indicate if last decoded value was null
      Parameters:
      nullBitmap - null bitmap
      fieldIndex - field index
      fieldLength - field length
      Returns:
      true if last value was null
    • setPosition

      int setPosition(int newIndex, MutableInt fieldIndex, int maxIndex, StandardReadableByteBuf rowBuf, byte[] nullBitmap, ColumnDecoder[] metadataList)
      Position the read index on buffer to data at indicated index.
      Parameters:
      newIndex - new data index
      fieldIndex - current field index
      maxIndex - maximum index
      rowBuf - row buffer
      nullBitmap - null bitmap
      metadataList - metadata list
      Returns:
      new index to read data
    • decode

      <T> T decode(Codec<T> codec, Calendar calendar, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context) throws SQLException
      Decode data according to data type.
      Type Parameters:
      T - Codec default return type
      Parameters:
      codec - current codec
      calendar - calendar
      rowBuf - row buffer
      fieldLength - field length
      metadataList - metadatas
      fieldIndex - field index
      context - connection context
      Returns:
      default object according to metadata
      Throws:
      SQLException - if any decoding error occurs
    • defaultDecode

      Object defaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws SQLException
      Decode data according to data type.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      context - connection context
      Returns:
      data
      Throws:
      SQLException - if any decoding error occurs
    • decodeByte

      byte decodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException
      Decode data according to byte.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to byte value
    • decodeBoolean

      boolean decodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException
      Decode data according to boolean.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to boolean value
    • decodeDate

      Date decodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException
      Decode data according to Date.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      cal - calendar
      context - current context
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to Date value
    • decodeTime

      Time decodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException
      Decode data according to Time.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      cal - calendar
      context - connection context
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to Time value
    • decodeTimestamp

      Timestamp decodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException
      Decode data according to Timestamp.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      cal - calendar
      context - connection context
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to Timestamp value
    • decodeShort

      short decodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException
      Decode data according to short.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to short value
    • decodeInt

      int decodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException
      Decode data according to int.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to int value
    • decodeString

      String decodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws SQLException
      Decode data according to String.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      context - connection Context
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to String value
    • decodeLong

      long decodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException
      Decode data according to long.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to long value
    • decodeFloat

      float decodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException
      Decode data according to float.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to float value
    • decodeDouble

      double decodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException
      Decode data according to double.
      Parameters:
      metadataList - metadata list
      fieldIndex - field index
      rowBuf - row buffer
      fieldLength - field length
      Returns:
      data
      Throws:
      SQLException - if data type cannot be decoded to double value