T
- The temporal typepublic abstract class DefaultFormattedTemporalSerde<T extends java.time.temporal.TemporalAccessor> extends java.lang.Object implements TemporalSerde<T>
Serializer.EncoderContext
Deserializer.DecoderContext
UTC
Modifier | Constructor and Description |
---|---|
protected |
DefaultFormattedTemporalSerde(SerdeConfiguration configuration)
Allows configuring a default time format for temporal date/time types.
|
Modifier and Type | Method and Description |
---|---|
T |
deserializeNonNull(Decoder decoder,
Deserializer.DecoderContext decoderContext,
io.micronaut.core.type.Argument<? super T> type)
A method that is invoked when the value is known not to be null.
|
protected abstract T |
deserializeNonNullWithoutFormat(Decoder decoder,
Deserializer.DecoderContext decoderContext,
io.micronaut.core.type.Argument<? super T> type)
A method that is invoked when the value is known not to be null.
|
protected abstract java.time.format.DateTimeFormatter |
getDefaultFormatter() |
void |
serialize(Encoder encoder,
Serializer.EncoderContext context,
io.micronaut.core.type.Argument<? extends T> type,
T value)
Serializes the given value using the passed
Encoder . |
protected abstract void |
serializeWithoutFormat(Encoder encoder,
Serializer.EncoderContext context,
T value,
io.micronaut.core.type.Argument<? extends T> type)
Serializes the given value using the passed
Encoder . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSpecific, createSpecific, query
isAbsent, isEmpty
allowNull, deserialize
getDefaultValue
protected DefaultFormattedTemporalSerde(@NonNull SerdeConfiguration configuration)
configuration
- The configuration@NonNull protected abstract java.time.format.DateTimeFormatter getDefaultFormatter()
public final void serialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends T> type, T value) throws java.io.IOException
Serializer
Encoder
.serialize
in interface Serializer<T extends java.time.temporal.TemporalAccessor>
encoder
- The encoder to usecontext
- The encoder context, never null
type
- Models the generic type of the valuevalue
- The value, can be null
java.io.IOException
- If an error occurs during serializationpublic final T deserializeNonNull(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super T> type) throws java.io.IOException
NullableDeserializer
deserializeNonNull
in interface NullableDeserializer<T extends java.time.temporal.TemporalAccessor>
decoder
- The decoderdecoderContext
- The decoder contexttype
- The typejava.io.IOException
- if something goes wrong during deserializationprotected abstract void serializeWithoutFormat(Encoder encoder, Serializer.EncoderContext context, T value, io.micronaut.core.type.Argument<? extends T> type) throws java.io.IOException
Encoder
.encoder
- The encoder to usecontext
- The encoder context, never null
value
- The value, can be null
type
- Models the generic type of the valuejava.io.IOException
- If an error occurs during serializationprotected abstract T deserializeNonNullWithoutFormat(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super T> type) throws java.io.IOException
decoder
- The decoderdecoderContext
- The decoder contexttype
- The typejava.io.IOException
- if something goes wrong during deserialization