Class YearSerde
java.lang.Object
io.micronaut.serde.support.serdes.YearSerde
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,Deserializer<Year>
,Serde<Year>
,Serializer<Year>
,DeserializerRegistrar<Year>
,SerdeRegistrar<Year>
,TemporalSerde<Year>
,SerializerRegistrar<Year>
Serde for year.
- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.serde.Deserializer
Deserializer.DecoderContext
Nested classes/interfaces inherited from interface io.micronaut.serde.Serializer
Serializer.EncoderContext
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Fields inherited from interface io.micronaut.serde.support.serdes.TemporalSerde
UTC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super Year> type) Deserializes from the current state of theDecoder
an object of typeDeserializer
.io.micronaut.core.type.Argument<Year>
getType()
query()
void
serialize
(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Year> type, Year value) Serializes the given value using the passedEncoder
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.serde.Deserializer
allowNull, deserializeNullable, getDefaultValue
Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
Methods inherited from interface io.micronaut.serde.support.SerdeRegistrar
getTypes
Methods inherited from interface io.micronaut.serde.Serializer
isAbsent, isEmpty
Methods inherited from interface io.micronaut.serde.support.serdes.TemporalSerde
createSpecific, createSpecific
-
Constructor Details
-
YearSerde
public YearSerde()
-
-
Method Details
-
serialize
public void serialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Year> type, Year value) throws IOException Description copied from interface:Serializer
Serializes the given value using the passedEncoder
.- Specified by:
serialize
in interfaceSerializer<Year>
- Parameters:
encoder
- The encoder to usecontext
- The encoder context, nevernull
type
- Models the generic type of the valuevalue
- The value, can benull
- Throws:
IOException
- If an error occurs during serialization
-
query
- Specified by:
query
in interfaceTemporalSerde<Year>
- Returns:
- The temporal query for the type.
-
deserialize
public Year deserialize(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super Year> type) throws IOException Description copied from interface:Deserializer
Deserializes from the current state of theDecoder
an object of typeDeserializer
.- Specified by:
deserialize
in interfaceDeserializer<Year>
- Parameters:
decoder
- The decoder, nevernull
decoderContext
- The decoder context, nevernull
type
- The generic type to be deserialized- Returns:
- The deserialized object or
null
only ifDeserializer.allowNull()
returnstrue
- Throws:
IOException
- If an error occurs during deserialization of the object
-
getType
- Specified by:
getType
in interfaceDeserializerRegistrar<Year>
- Specified by:
getType
in interfaceSerdeRegistrar<Year>
- Specified by:
getType
in interfaceSerializerRegistrar<Year>
- Returns:
- The serde argument type
-