@Singleton public class YearSerde extends java.lang.Object implements TemporalSerde<java.time.Year>
Serializer.EncoderContext
Deserializer.DecoderContext
UTC
Constructor and Description |
---|
YearSerde() |
Modifier and Type | Method and Description |
---|---|
java.time.Year |
deserializeNonNull(Decoder decoder,
Deserializer.DecoderContext decoderContext,
io.micronaut.core.type.Argument<? super java.time.Year> type)
A method that is invoked when the value is known not to be null.
|
java.time.temporal.TemporalQuery<java.time.Year> |
query() |
void |
serialize(Encoder encoder,
Serializer.EncoderContext context,
io.micronaut.core.type.Argument<? extends java.time.Year> type,
java.time.Year value)
Serializes the given value using the passed
Encoder . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSpecific, createSpecific
isAbsent, isEmpty
allowNull, deserialize
getDefaultValue
public void serialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends java.time.Year> type, java.time.Year value) throws java.io.IOException
Serializer
Encoder
.serialize
in interface Serializer<java.time.Year>
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 java.time.temporal.TemporalQuery<java.time.Year> query()
query
in interface TemporalSerde<java.time.Year>
public java.time.Year deserializeNonNull(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super java.time.Year> type) throws java.io.IOException
NullableDeserializer
deserializeNonNull
in interface NullableDeserializer<java.time.Year>
decoder
- The decoderdecoderContext
- The decoder contexttype
- The typejava.io.IOException
- if something goes wrong during deserialization