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 Deserializer
Deserializer.DecoderContextNested classes/interfaces inherited from interface Serializer
Serializer.EncoderContext -
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEFields inherited from interface TemporalSerde
UTC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super Year> type) io.micronaut.core.type.Argument<Year> getType()query()voidserialize(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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Deserializer
deserializeNullable, getDefaultValueMethods inherited from interface io.micronaut.core.order.Ordered
getOrderMethods inherited from interface SerdeRegistrar
getTypesMethods inherited from interface Serializer
isAbsent, isDefault, isEmptyMethods inherited from interface 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:SerializerSerializes the given value using the passedEncoder.- Specified by:
serializein interfaceSerializer<Year>- Parameters:
encoder- The encoder to usecontext- The encoder context, nevernulltype- Models the generic type of the valuevalue- The value, can benull- Throws:
IOException- If an error occurs during serialization
-
query
- Specified by:
queryin 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- Specified by:
deserializein interfaceDeserializer<Year>- Parameters:
decoder- The decoder, nevernulldecoderContext- The decoder context, nevernulltype- The generic type to be deserialized- Returns:
- The deserialized object or
null - Throws:
IOException- If an error occurs during deserialization of the object
-
getType
- Specified by:
getTypein interfaceDeserializerRegistrar<Year>- Specified by:
getTypein interfaceSerdeRegistrar<Year>- Specified by:
getTypein interfaceSerializerRegistrar<Year>- Returns:
- The serde argument type
-