T - The temporal typepublic abstract class DefaultFormattedTemporalSerde<T extends java.time.temporal.TemporalAccessor> extends java.lang.Object implements TemporalSerde<T>
Serializer.EncoderContextDeserializer.DecoderContextUTC| 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,
T value,
io.micronaut.core.type.Argument<? extends T> type)
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, waitcreateSpecific, createSpecific, queryisAbsent, isEmptyallowNull, deserializegetDefaultValueprotected DefaultFormattedTemporalSerde(@NonNull
SerdeConfiguration configuration)
configuration - The configuration@NonNull protected abstract java.time.format.DateTimeFormatter getDefaultFormatter()
public final void serialize(Encoder encoder, Serializer.EncoderContext context, T value, io.micronaut.core.type.Argument<? extends T> type) throws java.io.IOException
SerializerEncoder.serialize in interface Serializer<T extends java.time.temporal.TemporalAccessor>encoder - The encoder to usecontext - The encoder context, never nullvalue - The value, can be nulltype - Models the generic type of the valuejava.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
NullableDeserializerdeserializeNonNull 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 nullvalue - The value, can be nulltype - 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