Class LocalDateTimeCodec

  • All Implemented Interfaces:
    Codec<java.time.LocalDateTime>

    public class LocalDateTimeCodec
    extends java.lang.Object
    implements Codec<java.time.LocalDateTime>
    • Field Detail

      • TIMESTAMP_FORMAT

        public static final java.time.format.DateTimeFormatter TIMESTAMP_FORMAT
      • TIMESTAMP_FORMAT_NO_FRACTIONAL

        public static final java.time.format.DateTimeFormatter TIMESTAMP_FORMAT_NO_FRACTIONAL
      • MARIADB_LOCAL_DATE_TIME

        public static final java.time.format.DateTimeFormatter MARIADB_LOCAL_DATE_TIME
      • COMPATIBLE_TYPES

        private static final java.util.EnumSet<DataType> COMPATIBLE_TYPES
    • Constructor Detail

      • LocalDateTimeCodec

        public LocalDateTimeCodec()
    • Method Detail

      • parseTimestamp

        public static int[] parseTimestamp​(java.lang.String raw)
                                    throws java.time.DateTimeException
        Throws:
        java.time.DateTimeException
      • className

        public java.lang.String className()
        Specified by:
        className in interface Codec<java.time.LocalDateTime>
      • canEncode

        public boolean canEncode​(java.lang.Object value)
        Specified by:
        canEncode in interface Codec<java.time.LocalDateTime>
      • decodeText

        public java.time.LocalDateTime decodeText​(ReadableByteBuf buf,
                                                  int length,
                                                  ColumnDefinitionPacket column,
                                                  java.util.Calendar cal)
                                           throws java.sql.SQLDataException
        Specified by:
        decodeText in interface Codec<java.time.LocalDateTime>
        Throws:
        java.sql.SQLDataException
      • decodeBinary

        public java.time.LocalDateTime decodeBinary​(ReadableByteBuf buf,
                                                    int length,
                                                    ColumnDefinitionPacket column,
                                                    java.util.Calendar cal)
                                             throws java.sql.SQLDataException
        Specified by:
        decodeBinary in interface Codec<java.time.LocalDateTime>
        Throws:
        java.sql.SQLDataException
      • encodeText

        public void encodeText​(PacketWriter encoder,
                               Context context,
                               java.lang.Object value,
                               java.util.Calendar cal,
                               java.lang.Long maxLen)
                        throws java.io.IOException
        Specified by:
        encodeText in interface Codec<java.time.LocalDateTime>
        Throws:
        java.io.IOException
      • encodeBinary

        public void encodeBinary​(PacketWriter encoder,
                                 java.lang.Object value,
                                 java.util.Calendar cal,
                                 java.lang.Long maxLength)
                          throws java.io.IOException
        Specified by:
        encodeBinary in interface Codec<java.time.LocalDateTime>
        Throws:
        java.io.IOException
      • getBinaryEncodeType

        public int getBinaryEncodeType()
        Specified by:
        getBinaryEncodeType in interface Codec<java.time.LocalDateTime>