Class ZonedDateTimeSerde
java.lang.Object
io.micronaut.serde.support.serdes.DefaultFormattedTemporalSerde<ZonedDateTime>
io.micronaut.serde.support.serdes.ZonedDateTimeSerde
- All Implemented Interfaces:
io.micronaut.core.order.Ordered, Deserializer<ZonedDateTime>, FormattedDeserializer<ZonedDateTime>, FormattedSerde<ZonedDateTime>, FormattedSerializer<ZonedDateTime>, Serde<ZonedDateTime>, Serializer<ZonedDateTime>, DeserializerRegistrar<ZonedDateTime>, SerdeRegistrar<ZonedDateTime>, TemporalSerde<ZonedDateTime>, SerializerRegistrar<ZonedDateTime>
public final class ZonedDateTimeSerde
extends DefaultFormattedTemporalSerde<ZonedDateTime>
implements TemporalSerde<ZonedDateTime>, SerdeRegistrar<ZonedDateTime>
Zoned date time serde.
- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface Deserializer
Deserializer.DecoderContextNested classes/interfaces inherited from interface Serializer
Serializer.EncoderContext -
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEFields inherited from interface TemporalSerde
UTC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DefaultFormattedTemporalSerde<ZonedDateTime> createSpecific(DateTimeFormatter stringFormatter, SerdeConfiguration.TimeShape timeWriteShape, SerdeConfiguration.NumericTimeUnit numericUnit) Create the same serde with a new string formatter and explicit shape-derived values.protected DefaultFormattedTemporalSerde<ZonedDateTime> createSpecific(DateTimeFormatter stringFormatter, SerdeConfiguration.TimeShape timeWriteShape, SerdeConfiguration.NumericTimeUnit numericUnit, FormatConfiguration format) Create the same serde with a new string formatter and explicit format-derived values.protected DefaultFormattedTemporalSerde<ZonedDateTime> createSpecificForDeserialization(DateTimeFormatter stringFormatter, SerdeConfiguration.TimeShape timeWriteShape, SerdeConfiguration.NumericTimeUnit numericUnit, SerdeConfiguration configuration, Set<DeserializationConfiguration.Feature> features) Create the same serde with deserialization configuration-derived values.protected DefaultFormattedTemporalSerde<ZonedDateTime> createSpecificForDeserialization(DateTimeFormatter stringFormatter, SerdeConfiguration.TimeShape timeWriteShape, SerdeConfiguration.NumericTimeUnit numericUnit, FormatConfiguration format, Set<DeserializationConfiguration.Feature> features) Create the same serde with deserialization format-derived values.protected DateTimeFormatterdefaultStringFormatter(FormatConfiguration format, Set<SerializationConfiguration.Feature> features) protected ZonedDateTimefromNanos(long seconds, int nanos) protected intgetNanoPart(ZonedDateTime value) protected longgetSecondPart(ZonedDateTime value) io.micronaut.core.type.Argument<ZonedDateTime> getType()query()Methods inherited from class DefaultFormattedTemporalSerde
createFormatter, createSpecific, createSpecific, createSpecific, createSpecific, createSpecific, createSpecificForSerialization, defaultStringFormatter, defaultStringFormatter, deserialize, serializeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Deserializer
deserialize, deserializeNullable, getDefaultValueMethods inherited from interface io.micronaut.core.order.Ordered
getOrderMethods inherited from interface SerdeRegistrar
getTypesMethods inherited from interface Serializer
isAbsent, isDefault, isEmpty, serializeMethods inherited from interface TemporalSerde
createSpecific, createSpecific, createSpecific, createSpecific
-
Constructor Details
-
ZonedDateTimeSerde
-
-
Method Details
-
query
- Specified by:
queryin interfaceTemporalSerde<ZonedDateTime>- Returns:
- The temporal query for the type.
-
fromNanos
-
getSecondPart
-
getNanoPart
-
createSpecific
protected DefaultFormattedTemporalSerde<ZonedDateTime> createSpecific(DateTimeFormatter stringFormatter, SerdeConfiguration.TimeShape timeWriteShape, SerdeConfiguration.NumericTimeUnit numericUnit) Description copied from class:DefaultFormattedTemporalSerdeCreate the same serde with a new string formatter and explicit shape-derived values.- Overrides:
createSpecificin classDefaultFormattedTemporalSerde<ZonedDateTime>- Parameters:
stringFormatter- The resolved string formattertimeWriteShape- The time write shapenumericUnit- The numeric time unit- Returns:
- The updated serde
-
createSpecific
protected DefaultFormattedTemporalSerde<ZonedDateTime> createSpecific(DateTimeFormatter stringFormatter, SerdeConfiguration.TimeShape timeWriteShape, SerdeConfiguration.NumericTimeUnit numericUnit, FormatConfiguration format) Description copied from class:DefaultFormattedTemporalSerdeCreate the same serde with a new string formatter and explicit format-derived values.- Overrides:
createSpecificin classDefaultFormattedTemporalSerde<ZonedDateTime>- Parameters:
stringFormatter- The resolved string formattertimeWriteShape- The time write shapenumericUnit- The numeric time unitformat- The format configuration- Returns:
- The updated serde
-
createSpecificForDeserialization
protected DefaultFormattedTemporalSerde<ZonedDateTime> createSpecificForDeserialization(DateTimeFormatter stringFormatter, SerdeConfiguration.TimeShape timeWriteShape, SerdeConfiguration.NumericTimeUnit numericUnit, FormatConfiguration format, Set<DeserializationConfiguration.Feature> features) Description copied from class:DefaultFormattedTemporalSerdeCreate the same serde with deserialization format-derived values.- Overrides:
createSpecificForDeserializationin classDefaultFormattedTemporalSerde<ZonedDateTime>- Parameters:
stringFormatter- The resolved string formattertimeWriteShape- The time write shapenumericUnit- The numeric time unitformat- The format configurationfeatures- The active deserialization features- Returns:
- The updated serde
-
createSpecificForDeserialization
protected DefaultFormattedTemporalSerde<ZonedDateTime> createSpecificForDeserialization(DateTimeFormatter stringFormatter, SerdeConfiguration.TimeShape timeWriteShape, SerdeConfiguration.NumericTimeUnit numericUnit, SerdeConfiguration configuration, Set<DeserializationConfiguration.Feature> features) Description copied from class:DefaultFormattedTemporalSerdeCreate the same serde with deserialization configuration-derived values.- Overrides:
createSpecificForDeserializationin classDefaultFormattedTemporalSerde<ZonedDateTime>- Parameters:
stringFormatter- The resolved string formattertimeWriteShape- The time write shapenumericUnit- The numeric time unitconfiguration- The serde configurationfeatures- The active deserialization features- Returns:
- The updated serde
-
getType
- Specified by:
getTypein interfaceDeserializerRegistrar<ZonedDateTime>- Specified by:
getTypein interfaceSerdeRegistrar<ZonedDateTime>- Specified by:
getTypein interfaceSerializerRegistrar<ZonedDateTime>- Returns:
- The serde argument type
-
defaultStringFormatter
protected DateTimeFormatter defaultStringFormatter(FormatConfiguration format, Set<SerializationConfiguration.Feature> features) - Overrides:
defaultStringFormatterin classDefaultFormattedTemporalSerde<ZonedDateTime>- Parameters:
format- The format configurationfeatures- The active serialization features- Returns:
- The default formatter to use for this format when configuration doesn't define one.
-