Class ZonedDateTimeSerializer
java.lang.Object
org.eclipse.yasson.internal.serializer.types.TypeSerializer<ZonedDateTime>
org.eclipse.yasson.internal.serializer.types.AbstractDateSerializer<ZonedDateTime>
org.eclipse.yasson.internal.serializer.types.ZonedDateTimeSerializer
- All Implemented Interfaces:
ModelSerializer
Serializer of the
ZonedDateTime type.-
Field Summary
Fields inherited from class AbstractDateSerializer
UTC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringformatDefault(ZonedDateTime value, Locale locale) Format with default formatter for a given java.time date object.protected InstanttoInstant(ZonedDateTime value) Convert java.time object to epoch milliseconds instant.Methods inherited from class AbstractDateSerializer
formatStrictIJson, formatWithFormatter, getZonedFormatter, serializeKey, serializeValue, toTemporalAccessorMethods inherited from class TypeSerializer
serialize
-
Constructor Details
-
ZonedDateTimeSerializer
ZonedDateTimeSerializer(TypeSerializerBuilder serializerBuilder)
-
-
Method Details
-
toInstant
Description copied from class:AbstractDateSerializerConvert java.time object to epoch milliseconds instant. Discards zone offset and zone id information.- Specified by:
toInstantin classAbstractDateSerializer<ZonedDateTime>- Parameters:
value- date object to convert- Returns:
- instant
-
formatDefault
Description copied from class:AbstractDateSerializerFormat with default formatter for a given java.time date object. Different default formatter for each date object type is used.- Specified by:
formatDefaultin classAbstractDateSerializer<ZonedDateTime>- Parameters:
value- date objectlocale- locale from annotation / default not null- Returns:
- formatted date obj as string
-