@Singleton public class LocalDateSerde extends DefaultFormattedTemporalSerde<java.time.LocalDate> implements TemporalSerde<java.time.LocalDate>
Serializer.EncoderContext
Deserializer.DecoderContext
UTC
Modifier | Constructor and Description |
---|---|
protected |
LocalDateSerde(SerdeConfiguration configuration)
Allows configuring a default time format for temporal date/time types.
|
Modifier and Type | Method and Description |
---|---|
protected java.time.LocalDate |
deserializeNonNullWithoutFormat(Decoder decoder,
Deserializer.DecoderContext decoderContext,
io.micronaut.core.type.Argument<? super java.time.LocalDate> type)
A method that is invoked when the value is known not to be null.
|
protected java.time.format.DateTimeFormatter |
getDefaultFormatter() |
java.time.temporal.TemporalQuery<java.time.LocalDate> |
query() |
protected void |
serializeWithoutFormat(Encoder encoder,
Serializer.EncoderContext context,
java.time.LocalDate value,
io.micronaut.core.type.Argument<? extends java.time.LocalDate> type)
Serializes the given value using the passed
Encoder . |
deserializeNonNull, serialize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSpecific, createSpecific
isAbsent, isEmpty, serialize
allowNull, deserialize, deserializeNonNull
getDefaultValue
protected LocalDateSerde(SerdeConfiguration configuration)
configuration
- The configurationprotected java.time.format.DateTimeFormatter getDefaultFormatter()
getDefaultFormatter
in class DefaultFormattedTemporalSerde<java.time.LocalDate>
public java.time.temporal.TemporalQuery<java.time.LocalDate> query()
query
in interface TemporalSerde<java.time.LocalDate>
protected void serializeWithoutFormat(Encoder encoder, Serializer.EncoderContext context, java.time.LocalDate value, io.micronaut.core.type.Argument<? extends java.time.LocalDate> type) throws java.io.IOException
DefaultFormattedTemporalSerde
Encoder
.serializeWithoutFormat
in class DefaultFormattedTemporalSerde<java.time.LocalDate>
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 java.time.LocalDate deserializeNonNullWithoutFormat(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super java.time.LocalDate> type) throws java.io.IOException
DefaultFormattedTemporalSerde
deserializeNonNullWithoutFormat
in class DefaultFormattedTemporalSerde<java.time.LocalDate>
decoder
- The decoderdecoderContext
- The decoder contexttype
- The typejava.io.IOException
- if something goes wrong during deserialization