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.DecoderContextNested 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_PRECEDENCEFields inherited from interface io.micronaut.serde.support.serdes.TemporalSerde
UTC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super Year> type) Deserializes from the current state of theDecoderan object of typeDeserializer.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.serde.Deserializer
allowNull, deserializeNullable, getDefaultValueMethods inherited from interface io.micronaut.core.order.Ordered
getOrderMethods inherited from interface io.micronaut.serde.support.SerdeRegistrar
getTypesMethods inherited from interface io.micronaut.serde.Serializer
isAbsent, isDefault, isEmptyMethods 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: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:DeserializerDeserializes from the current state of theDecoderan object of typeDeserializer.- 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
nullonly ifDeserializer.allowNull()returnstrue - 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
-