Class ZonedDateTimeSerde
java.lang.Object
io.micronaut.serde.support.serdes.DefaultFormattedTemporalSerde<ZonedDateTime>
io.micronaut.serde.support.serdes.ZonedDateTimeSerde
- All Implemented Interfaces:
Deserializer<ZonedDateTime>
,Serde<ZonedDateTime>
,Serializer<ZonedDateTime>
,TemporalSerde<ZonedDateTime>
@Singleton
public class ZonedDateTimeSerde
extends DefaultFormattedTemporalSerde<ZonedDateTime>
implements TemporalSerde<ZonedDateTime>
Zoned date time serde.
- Since:
- 1.0.0
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ZonedDateTime
deserializeNonNullWithoutFormat
(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super ZonedDateTime> 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, ZonedDateTime value, io.micronaut.core.type.Argument<? extends ZonedDateTime> 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, deserialize, getDefaultValue
Methods inherited from interface io.micronaut.serde.Serializer
isAbsent, isEmpty, serialize
Methods inherited from interface io.micronaut.serde.support.serdes.TemporalSerde
createSpecific, createSpecific
-
Constructor Details
-
ZonedDateTimeSerde
-
-
Method Details
-
getDefaultFormatter
- Specified by:
getDefaultFormatter
in classDefaultFormattedTemporalSerde<ZonedDateTime>
- Returns:
- The default formatter.
-
query
- Specified by:
query
in interfaceTemporalSerde<ZonedDateTime>
- Returns:
- The temporal query for the type.
-
serializeWithoutFormat
protected void serializeWithoutFormat(Encoder encoder, Serializer.EncoderContext context, ZonedDateTime value, io.micronaut.core.type.Argument<? extends ZonedDateTime> type) throws IOException Description copied from class:DefaultFormattedTemporalSerde
Serializes the given value using the passedEncoder
.- Specified by:
serializeWithoutFormat
in classDefaultFormattedTemporalSerde<ZonedDateTime>
- 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 ZonedDateTime deserializeNonNullWithoutFormat(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super ZonedDateTime> 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<ZonedDateTime>
- Parameters:
decoder
- The decoderdecoderContext
- The decoder contexttype
- The type- Returns:
- The value
- Throws:
IOException
- if something goes wrong during deserialization
-