Package org.mariadb.jdbc.plugin.codec
Class DoubleCodec
- java.lang.Object
-
- org.mariadb.jdbc.plugin.codec.DoubleCodec
-
-
Field Summary
Fields Modifier and Type Field Description static DoubleCodecINSTANCEdefault instance
-
Constructor Summary
Constructors Constructor Description DoubleCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDecode(org.mariadb.jdbc.client.Column column, Class<?> type)If codec can decode this a server datatype to a java class typebooleancanEncode(Object value)Can Codec encode the java object typeStringclassName()Codec native typeDoubledecodeBinary(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column, Calendar cal)Decode from a mysql packet binary encoded a value to codec java typedoubledecodeBinaryDouble(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column)Decode Double from binary dataDoubledecodeText(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column, Calendar cal)Decode from a mysql packet text encoded a value to codec java typedoubledecodeTextDouble(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column)Decode Double from text datavoidencodeBinary(Writer encoder, Object value, Calendar cal, Long maxLength)Binary encode value to writervoidencodeText(Writer encoder, org.mariadb.jdbc.client.Context context, Object value, Calendar cal, Long maxLen)Text encode value to writerintgetBinaryEncodeType()Return server encoding data type-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mariadb.jdbc.plugin.Codec
canEncodeLongData, encodeData, encodeLongData
-
-
-
-
Field Detail
-
INSTANCE
public static final DoubleCodec INSTANCE
default instance
-
-
Method Detail
-
canDecode
public boolean canDecode(org.mariadb.jdbc.client.Column column, Class<?> type)Description copied from interface:CodecIf codec can decode this a server datatype to a java class type
-
canEncode
public boolean canEncode(Object value)
Description copied from interface:CodecCan Codec encode the java object type
-
decodeText
public Double decodeText(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column, Calendar cal) throws SQLDataException
Description copied from interface:CodecDecode from a mysql packet text encoded a value to codec java type- Specified by:
decodeTextin interfaceCodec<Double>- Parameters:
buf- mysql packet bufferlength- encoded value lengthcolumn- server column metadatacal- calendar- Returns:
- decoded value
- Throws:
SQLDataException- if unexpected error occurs during decoding
-
decodeTextDouble
public double decodeTextDouble(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column) throws SQLDataExceptionDecode Double from text data- Parameters:
buf- packet bufferlength- data lengthcolumn- column meta- Returns:
- double value
- Throws:
SQLDataException- if decoding error
-
decodeBinary
public Double decodeBinary(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column, Calendar cal) throws SQLDataException
Description copied from interface:CodecDecode from a mysql packet binary encoded a value to codec java type- Specified by:
decodeBinaryin interfaceCodec<Double>- Parameters:
buf- mysql packet bufferlength- encoded value lengthcolumn- server column metadatacal- calendar- Returns:
- decoded value
- Throws:
SQLDataException- if unexpected error occurs during decoding
-
decodeBinaryDouble
public double decodeBinaryDouble(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column) throws SQLDataExceptionDecode Double from binary data- Parameters:
buf- packet bufferlength- data lengthcolumn- column meta- Returns:
- double value
- Throws:
SQLDataException- if decoding error
-
encodeText
public void encodeText(Writer encoder, org.mariadb.jdbc.client.Context context, Object value, Calendar cal, Long maxLen) throws IOException
Description copied from interface:CodecText encode value to writer- Specified by:
encodeTextin interfaceCodec<Double>- Parameters:
encoder- writercontext- connection contextvalue- value to encodecal- calendarmaxLen- maximum value length- Throws:
IOException- if any socket error occurs
-
encodeBinary
public void encodeBinary(Writer encoder, Object value, Calendar cal, Long maxLength) throws IOException
Description copied from interface:CodecBinary encode value to writer- Specified by:
encodeBinaryin interfaceCodec<Double>- Parameters:
encoder- writervalue- 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<Double>- Returns:
- server encoding data type
-
-