Package org.mariadb.jdbc.plugin.codec

## Class LocalDateTimeCodec

- java.lang.Object
- - org.mariadb.jdbc.plugin.codec.LocalDateTimeCodec

All Implemented Interfaces:
  `Codec<LocalDateTime>`

    public class LocalDateTimeCodec
    extends Object
    implements Codec<LocalDateTime>

### Field Summary

Fields
`static LocalDateTimeCodec` `INSTANCE`
`static DateTimeFormatter` `MARIADB_LOCAL_DATE_TIME`
`static DateTimeFormatter` `TIMESTAMP_FORMAT`
`static DateTimeFormatter` `TIMESTAMP_FORMAT_NO_FRACTIONAL`

### Constructor Summary

Constructors
`LocalDateTimeCodec()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `canDecode​(org.mariadb.jdbc.client.Column column, Class<?> type)`
`boolean` `canEncode​(Object value)`
`String` `className()`
`LocalDateTime` `decodeBinary​(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column, Calendar cal)`
`LocalDateTime` `decodeText​(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column, Calendar cal)`
`void` `encodeBinary​(Writer encoder, Object value, Calendar cal, Long maxLength)`
`void` `encodeText​(Writer encoder, org.mariadb.jdbc.client.Context context, Object value, Calendar cal, Long maxLen)`
`int` `getBinaryEncodeType()`
`static int[]` `parseTimestamp​(String raw)`

### 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 LocalDateTimeCodec INSTANCE

#### TIMESTAMP_FORMAT

    public static final DateTimeFormatter TIMESTAMP_FORMAT

#### TIMESTAMP_FORMAT_NO_FRACTIONAL

    public static final DateTimeFormatter TIMESTAMP_FORMAT_NO_FRACTIONAL

#### MARIADB_LOCAL_DATE_TIME

    public static final DateTimeFormatter MARIADB_LOCAL_DATE_TIME

### Constructor Detail

#### LocalDateTimeCodec

    public LocalDateTimeCodec()

### Method Detail

#### parseTimestamp

    public static int[] parseTimestamp​(String raw)
                                throws DateTimeException

Throws:
  `DateTimeException`

#### className

    public String className()

Specified by:
  `className` in interface `Codec<LocalDateTime>`

#### canDecode

    public boolean canDecode​(org.mariadb.jdbc.client.Column column,
                             Class<?> type)

Specified by:
  `canDecode` in interface `Codec<LocalDateTime>`

#### canEncode

    public boolean canEncode​(Object value)

Specified by:
  `canEncode` in interface `Codec<LocalDateTime>`

#### decodeText

    public LocalDateTime decodeText​(org.mariadb.jdbc.client.ReadableByteBuf buf,
                                    int length,
                                    org.mariadb.jdbc.client.Column column,
                                    Calendar cal)
                             throws SQLDataException

Specified by:
  `decodeText` in interface `Codec<LocalDateTime>`
Throws:
  `SQLDataException`

#### decodeBinary

    public LocalDateTime decodeBinary​(org.mariadb.jdbc.client.ReadableByteBuf buf,
                                      int length,
                                      org.mariadb.jdbc.client.Column column,
                                      Calendar cal)
                               throws SQLDataException

Specified by:
  `decodeBinary` in interface `Codec<LocalDateTime>`
Throws:
  `SQLDataException`

#### encodeText

    public void encodeText​(Writer encoder,
                           org.mariadb.jdbc.client.Context context,
                           Object value,
                           Calendar cal,
                           Long maxLen)
                    throws IOException

Specified by:
  `encodeText` in interface `Codec<LocalDateTime>`
Throws:
  `IOException`

#### encodeBinary

    public void encodeBinary​(Writer encoder,
                             Object value,
                             Calendar cal,
                             Long maxLength)
                      throws IOException

Specified by:
  `encodeBinary` in interface `Codec<LocalDateTime>`
Throws:
  `IOException`

#### getBinaryEncodeType

    public int getBinaryEncodeType()

Specified by:
  `getBinaryEncodeType` in interface `Codec<LocalDateTime>`