Class BooleanCodec
java.lang.Object
org.mariadb.jdbc.plugin.codec.BooleanCodec
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecode(ColumnDecoder column, Class<?> type) If codec can decode this a server datatype to a java class typebooleanCan Codec encode the java object typeCodec native typedecodeBinary(ReadableByteBuf buffer, MutableInt length, ColumnDecoder column, Calendar cal, Context context) Decode from a mysql packet binary encoded a value to codec java typedecodeText(ReadableByteBuf buffer, MutableInt length, ColumnDecoder column, Calendar cal, Context context) Decode from a mysql packet text encoded a value to codec java typevoidBinary encode value to writervoidText encode value to writerintgetApproximateTextProtocolLength(Boolean value, Long length) Get approximate text length, or -1 if unknownintReturn server encoding data typeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Codec
canEncodeLongData, encodeData, encodeLongData
-
Field Details
-
INSTANCE
default instance -
COMPATIBLE_TYPES
-
-
Constructor Details
-
BooleanCodec
public BooleanCodec()
-
-
Method Details
-
className
-
canDecode
Description copied from interface:CodecIf codec can decode this a server datatype to a java class type -
canEncode
-
decodeText
public Boolean decodeText(ReadableByteBuf buffer, MutableInt length, ColumnDecoder column, Calendar cal, Context context) throws SQLDataException Description copied from interface:CodecDecode from a mysql packet text encoded a value to codec java type- Specified by:
decodeTextin interfaceCodec<Boolean>- Parameters:
buffer- mysql packet bufferlength- encoded value lengthcolumn- server column metadatacal- calendarcontext- connection context- Returns:
- decoded value
- Throws:
SQLDataException- if unexpected error occurs during decoding
-
decodeBinary
public Boolean decodeBinary(ReadableByteBuf buffer, MutableInt length, ColumnDecoder column, Calendar cal, Context context) throws SQLDataException Description copied from interface:CodecDecode from a mysql packet binary encoded a value to codec java type- Specified by:
decodeBinaryin interfaceCodec<Boolean>- Parameters:
buffer- mysql packet bufferlength- encoded value lengthcolumn- server column metadatacal- calendarcontext- connection context- Returns:
- decoded value
- Throws:
SQLDataException- if unexpected error occurs during decoding
-
encodeText
public void encodeText(Writer encoder, Context context, Boolean value, Calendar cal, Long maxLength) throws IOException Description copied from interface:CodecText encode value to writer- Specified by:
encodeTextin interfaceCodec<Boolean>- Parameters:
encoder- writercontext- connection contextvalue- value to encodecal- calendarmaxLength- maximum value length- Throws:
IOException- if any socket error occurs
-
getApproximateTextProtocolLength
Description copied from interface:CodecGet approximate text length, or -1 if unknown- Specified by:
getApproximateTextProtocolLengthin interfaceCodec<Boolean>- Parameters:
value- parameter objectlength- max length- Returns:
- max length if known, -1 if unknown
-
encodeBinary
public void encodeBinary(Writer encoder, Context context, Boolean value, Calendar cal, Long maxLength) throws IOException Description copied from interface:CodecBinary encode value to writer- Specified by:
encodeBinaryin interfaceCodec<Boolean>- Parameters:
encoder- writercontext- connection contextvalue- value to encodecal- calendarmaxLength- maximum value length- Throws:
IOException- if any socket error occurs
-
getBinaryEncodeType
public int getBinaryEncodeType()Description copied from interface:CodecReturn server encoding data type- Specified by:
getBinaryEncodeTypein interfaceCodec<Boolean>- Returns:
- server encoding data type
-