Class LocalDateTimeSerde

  • All Implemented Interfaces:
    io.micronaut.serde.Deserializer<java.time.LocalDateTime>, io.micronaut.serde.Serde<java.time.LocalDateTime>, io.micronaut.serde.Serializer<java.time.LocalDateTime>, TemporalSerde<java.time.LocalDateTime>, io.micronaut.serde.util.NullableDeserializer<java.time.LocalDateTime>, io.micronaut.serde.util.NullableSerde<java.time.LocalDateTime>

    @Singleton
    public class LocalDateTimeSerde
    extends DefaultFormattedTemporalSerde<java.time.LocalDateTime>
    implements TemporalSerde<java.time.LocalDateTime>
    Temporal serde for LocalDateTime.
    Since:
    1.0.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.micronaut.serde.Deserializer

        io.micronaut.serde.Deserializer.DecoderContext
      • Nested classes/interfaces inherited from interface io.micronaut.serde.Serializer

        io.micronaut.serde.Serializer.EncoderContext
    • Field Summary

      • Fields inherited from interface io.micronaut.serde.support.serdes.TemporalSerde

        UTC
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected LocalDateTimeSerde​(io.micronaut.serde.config.SerdeConfiguration configuration)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.time.LocalDateTime deserializeNonNullWithoutFormat​(io.micronaut.serde.Decoder decoder, io.micronaut.serde.Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super java.time.LocalDateTime> type)
      A method that is invoked when the value is known not to be null.
      protected java.time.format.DateTimeFormatter getDefaultFormatter()  
      java.time.temporal.TemporalQuery<java.time.LocalDateTime> query()  
      protected void serializeWithoutFormat​(io.micronaut.serde.Encoder encoder, io.micronaut.serde.Serializer.EncoderContext context, java.time.LocalDateTime value, io.micronaut.core.type.Argument<? extends java.time.LocalDateTime> type)
      Serializes the given value using the passed Encoder.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.micronaut.serde.Deserializer

        getDefaultValue
      • Methods inherited from interface io.micronaut.serde.util.NullableDeserializer

        allowNull, deserialize, deserializeNonNull
      • Methods inherited from interface io.micronaut.serde.Serializer

        isAbsent, isEmpty, serialize
    • Constructor Detail

      • LocalDateTimeSerde

        protected LocalDateTimeSerde​(io.micronaut.serde.config.SerdeConfiguration configuration)
    • Method Detail

      • query

        public java.time.temporal.TemporalQuery<java.time.LocalDateTime> query()
        Specified by:
        query in interface TemporalSerde<java.time.LocalDateTime>
        Returns:
        The temporal query for the type.
      • serializeWithoutFormat

        protected void serializeWithoutFormat​(io.micronaut.serde.Encoder encoder,
                                              io.micronaut.serde.Serializer.EncoderContext context,
                                              java.time.LocalDateTime value,
                                              io.micronaut.core.type.Argument<? extends java.time.LocalDateTime> type)
                                       throws java.io.IOException
        Description copied from class: DefaultFormattedTemporalSerde
        Serializes the given value using the passed Encoder.
        Specified by:
        serializeWithoutFormat in class DefaultFormattedTemporalSerde<java.time.LocalDateTime>
        Parameters:
        encoder - The encoder to use
        context - The encoder context, never null
        value - The value, can be null
        type - Models the generic type of the value
        Throws:
        java.io.IOException - If an error occurs during serialization
      • deserializeNonNullWithoutFormat

        protected java.time.LocalDateTime deserializeNonNullWithoutFormat​(io.micronaut.serde.Decoder decoder,
                                                                          io.micronaut.serde.Deserializer.DecoderContext decoderContext,
                                                                          io.micronaut.core.type.Argument<? super java.time.LocalDateTime> type)
                                                                   throws java.io.IOException
        Description copied from class: DefaultFormattedTemporalSerde
        A method that is invoked when the value is known not to be null.
        Specified by:
        deserializeNonNullWithoutFormat in class DefaultFormattedTemporalSerde<java.time.LocalDateTime>
        Parameters:
        decoder - The decoder
        decoderContext - The decoder context
        type - The type
        Returns:
        The value
        Throws:
        java.io.IOException - if something goes wrong during deserialization