Class OffsetDateTimeSerde
java.lang.Object
io.micronaut.serde.support.serdes.DefaultFormattedTemporalSerde<OffsetDateTime>
io.micronaut.serde.support.serdes.OffsetDateTimeSerde
- All Implemented Interfaces:
Deserializer<OffsetDateTime>
,Serde<OffsetDateTime>
,Serializer<OffsetDateTime>
,TemporalSerde<OffsetDateTime>
Serde for OffsetDateTime.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.serde.Deserializer
Deserializer.DecoderContext
Nested classes/interfaces inherited from interface io.micronaut.serde.Serializer
Serializer.EncoderContext
-
Field Summary
Fields inherited from interface io.micronaut.serde.support.serdes.TemporalSerde
UTC
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
OffsetDateTimeSerde
(SerdeConfiguration configuration) Allows configuring a default time format for temporal date/time types. -
Method Summary
Modifier and TypeMethodDescriptionprotected OffsetDateTime
deserializeNonNullWithoutFormat
(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super OffsetDateTime> type) A method that is invoked when the value is known not to be null.protected DateTimeFormatter
query()
protected void
serializeWithoutFormat
(Encoder encoder, Serializer.EncoderContext context, OffsetDateTime value, io.micronaut.core.type.Argument<? extends OffsetDateTime> type) Serializes the given value using the passedEncoder
.Methods inherited from class io.micronaut.serde.support.serdes.DefaultFormattedTemporalSerde
deserialize, serialize
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
allowNull, getDefaultValue
Methods inherited from interface io.micronaut.serde.Serializer
isAbsent, isEmpty
Methods inherited from interface io.micronaut.serde.support.serdes.TemporalSerde
createSpecific, createSpecific
-
Constructor Details
-
OffsetDateTimeSerde
Allows configuring a default time format for temporal date/time types.- Parameters:
configuration
- The configuration
-
-
Method Details
-
getDefaultFormatter
- Specified by:
getDefaultFormatter
in classDefaultFormattedTemporalSerde<OffsetDateTime>
- Returns:
- The default formatter.
-
query
- Returns:
- The temporal query for the type.
-
serializeWithoutFormat
protected void serializeWithoutFormat(Encoder encoder, Serializer.EncoderContext context, OffsetDateTime value, io.micronaut.core.type.Argument<? extends OffsetDateTime> type) throws IOException Description copied from class:DefaultFormattedTemporalSerde
Serializes the given value using the passedEncoder
.- Specified by:
serializeWithoutFormat
in classDefaultFormattedTemporalSerde<OffsetDateTime>
- Parameters:
encoder
- The encoder to usecontext
- The encoder context, nevernull
value
- The value, can benull
type
- Models the generic type of the value- Throws:
IOException
- If an error occurs during serialization
-
deserializeNonNullWithoutFormat
protected OffsetDateTime deserializeNonNullWithoutFormat(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super OffsetDateTime> type) throws IOException Description copied from class:DefaultFormattedTemporalSerde
A method that is invoked when the value is known not to be null.- Specified by:
deserializeNonNullWithoutFormat
in classDefaultFormattedTemporalSerde<OffsetDateTime>
- Parameters:
decoder
- The decoderdecoderContext
- The decoder contexttype
- The type- Returns:
- The value
- Throws:
IOException
- if something goes wrong during deserialization
-