Interface RowDecoder
-
- All Known Implementing Classes:
BinaryRowDecoder
,TextRowDecoder
public interface RowDecoder
Row decoder interface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
decode(Codec<T> codec, java.util.Calendar calendar, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context)
Decode data according to data type.boolean
decodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to boolean.byte
decodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to byte.java.sql.Date
decodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context)
Decode data according to Date.double
decodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to double.float
decodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to float.int
decodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to int.long
decodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to long.short
decodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to short.java.lang.String
decodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context)
Decode data according to String.java.sql.Time
decodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context)
Decode data according to Time.java.sql.Timestamp
decodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context)
Decode data according to Timestamp.java.lang.Object
defaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context)
Decode data according to data type.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.boolean
wasNull(byte[] nullBitmap, MutableInt fieldIndex, MutableInt fieldLength)
Indicate if last decoded value was null
-
-
-
Method Detail
-
wasNull
boolean wasNull(byte[] nullBitmap, MutableInt fieldIndex, MutableInt fieldLength)
Indicate if last decoded value was null- Parameters:
nullBitmap
- null bitmapfieldIndex
- field indexfieldLength
- 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 indexfieldIndex
- current field indexmaxIndex
- maximum indexrowBuf
- row buffernullBitmap
- null bitmapmetadataList
- metadata list- Returns:
- new index to read data
-
decode
<T> T decode(Codec<T> codec, java.util.Calendar calendar, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context) throws java.sql.SQLException
Decode data according to data type.- Type Parameters:
T
- Codec default return type- Parameters:
codec
- current codeccalendar
- calendarrowBuf
- row bufferfieldLength
- field lengthmetadataList
- metadatasfieldIndex
- field indexcontext
- connection context- Returns:
- default object according to metadata
- Throws:
java.sql.SQLException
- if any decoding error occurs
-
defaultDecode
java.lang.Object defaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws java.sql.SQLException
Decode data according to data type.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcontext
- connection context- Returns:
- data
- Throws:
java.sql.SQLException
- if any decoding error occurs
-
decodeByte
byte decodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Decode data according to byte.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to byte value
-
decodeBoolean
boolean decodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Decode data according to boolean.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to boolean value
-
decodeDate
java.sql.Date decodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context) throws java.sql.SQLException
Decode data according to Date.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- current context- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to Date value
-
decodeTime
java.sql.Time decodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context) throws java.sql.SQLException
Decode data according to Time.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- connection context- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to Time value
-
decodeTimestamp
java.sql.Timestamp decodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context) throws java.sql.SQLException
Decode data according to Timestamp.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- connection context- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to Timestamp value
-
decodeShort
short decodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Decode data according to short.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to short value
-
decodeInt
int decodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Decode data according to int.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to int value
-
decodeString
java.lang.String decodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws java.sql.SQLException
Decode data according to String.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcontext
- connection Context- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to String value
-
decodeLong
long decodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Decode data according to long.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to long value
-
decodeFloat
float decodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Decode data according to float.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to float value
-
decodeDouble
double decodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Decode data according to double.- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to double value
-
-