Class YearSerde
java.lang.Object
io.micronaut.serde.support.serdes.YearSerde
- All Implemented Interfaces:
io.micronaut.core.order.Ordered, Deserializer<Year>, FormattedDeserializer<Year>, FormattedSerde<Year>, FormattedSerializer<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 TypeMethodDescriptioncreateSpecific(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super Year> type, FormatConfiguration format) Create a more specific deserializer for the given definition and format configuration.createSpecific(Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Year> type, FormatConfiguration format) Create a more specific serializer for the given definition and format configuration.deserialize(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
-
createSpecific
public Serializer<Year> createSpecific(Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Year> type, FormatConfiguration format) Description copied from interface:FormattedSerializerCreate a more specific serializer for the given definition and format configuration.- Specified by:
createSpecificin interfaceFormattedSerializer<Year>- Specified by:
createSpecificin interfaceTemporalSerde<Year>- Parameters:
context- The encoder contexttype- The type definition including any annotation metadataformat- The format configuration- Returns:
- The more specific serializer
-
createSpecific
public Deserializer<Year> createSpecific(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super Year> type, FormatConfiguration format) throws SerdeException Description copied from interface:FormattedDeserializerCreate a more specific deserializer for the given definition and format configuration.- Specified by:
createSpecificin interfaceFormattedDeserializer<Year>- Specified by:
createSpecificin interfaceTemporalSerde<Year>- Parameters:
context- The decoder contexttype- The type definition including any annotation metadataformat- The format configuration- Returns:
- The more specific deserializer
- Throws:
SerdeException- If the deserializer cannot be selected
-
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
-