public class LocalDateTimeCodec extends Object implements Codec<LocalDateTime>
| Modifier and Type | Field and Description |
|---|---|
static LocalDateTimeCodec |
INSTANCE |
static DateTimeFormatter |
SINGLESTORE_LOCAL_DATE_TIME |
static DateTimeFormatter |
TIMESTAMP_FORMAT |
static DateTimeFormatter |
TIMESTAMP_FORMAT_NO_FRACTIONAL |
| Constructor and Description |
|---|
LocalDateTimeCodec() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDecode(com.singlestore.jdbc.client.ColumnDecoder column,
Class<?> type)
If codec can decode this a server datatype to a java class type
|
boolean |
canEncode(Object value)
Can Codec encode the java object type
|
String |
className()
Codec native type
|
LocalDateTime |
decodeBinary(com.singlestore.jdbc.client.ReadableByteBuf buf,
MutableInt length,
com.singlestore.jdbc.client.ColumnDecoder column,
Calendar cal)
Decode from a mysql packet binary encoded a value to codec java type
|
LocalDateTime |
decodeText(com.singlestore.jdbc.client.ReadableByteBuf buf,
MutableInt length,
com.singlestore.jdbc.client.ColumnDecoder column,
Calendar cal)
Decode from a mysql packet text encoded a value to codec java type
|
void |
encodeBinary(Writer encoder,
Object value,
Calendar cal,
Long maxLength)
Binary encode value to writer
|
void |
encodeText(Writer encoder,
com.singlestore.jdbc.client.Context context,
Object value,
Calendar cal,
Long maxLen)
Text encode value to writer
|
int |
getApproximateTextProtocolLength(Object value)
Approximate length in bytes.
|
int |
getBinaryEncodeType()
Return server encoding data type
|
static int[] |
parseTimestamp(String raw) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanEncodeLongData, encodeBinaryAsString, encodeData, encodeLongDatapublic static final LocalDateTimeCodec INSTANCE
public static final DateTimeFormatter TIMESTAMP_FORMAT
public static final DateTimeFormatter TIMESTAMP_FORMAT_NO_FRACTIONAL
public static final DateTimeFormatter SINGLESTORE_LOCAL_DATE_TIME
public static int[] parseTimestamp(String raw) throws DateTimeException
DateTimeExceptionpublic String className()
CodecclassName in interface Codec<LocalDateTime>public boolean canDecode(com.singlestore.jdbc.client.ColumnDecoder column,
Class<?> type)
CodeccanDecode in interface Codec<LocalDateTime>column - server datatypetype - java return classpublic boolean canEncode(Object value)
CodeccanEncode in interface Codec<LocalDateTime>value - java object typepublic int getApproximateTextProtocolLength(Object value) throws SQLException
CodecgetApproximateTextProtocolLength in interface Codec<LocalDateTime>value - to calculateSQLExceptionpublic LocalDateTime decodeText(com.singlestore.jdbc.client.ReadableByteBuf buf, MutableInt length, com.singlestore.jdbc.client.ColumnDecoder column, Calendar cal) throws SQLDataException
CodecdecodeText in interface Codec<LocalDateTime>buf - mysql packet bufferlength - encoded value lengthcolumn - server column metadatacal - calendarSQLDataException - if unexpected error occurs during decodingpublic LocalDateTime decodeBinary(com.singlestore.jdbc.client.ReadableByteBuf buf, MutableInt length, com.singlestore.jdbc.client.ColumnDecoder column, Calendar cal) throws SQLDataException
CodecdecodeBinary in interface Codec<LocalDateTime>buf - mysql packet bufferlength - encoded value lengthcolumn - server column metadatacal - calendarSQLDataException - if unexpected error occurs during decodingpublic void encodeText(Writer encoder, com.singlestore.jdbc.client.Context context, Object value, Calendar cal, Long maxLen) throws IOException
CodecencodeText in interface Codec<LocalDateTime>encoder - writercontext - connection contextvalue - value to encodecal - calendarmaxLen - maximum value lengthIOException - if any socket error occurspublic void encodeBinary(Writer encoder, Object value, Calendar cal, Long maxLength) throws IOException
CodecencodeBinary in interface Codec<LocalDateTime>encoder - writervalue - value to encodecal - calendarmaxLength - maximum value lengthIOException - if any socket error occurspublic int getBinaryEncodeType()
CodecgetBinaryEncodeType in interface Codec<LocalDateTime>Copyright © 2025 SingleStore. All rights reserved.