Interface NumberSerde<N extends Number>
- Type Parameters:
N- The number type
- All Superinterfaces:
Deserializer<N>, FormattedDeserializer<N>, FormattedSerde<N>, FormattedSerializer<N>, Serde<N>, Serializer<N>
Number serializer that handles formatting.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Deserializer
Deserializer.DecoderContextNested classes/interfaces inherited from interface Serializer
Serializer.EncoderContext -
Method Summary
Modifier and TypeMethodDescriptiondefault Deserializer<N> createSpecific(Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super N> context) Create a new child deserializer or return this if non is necessary for the given context.default Deserializer<N> createSpecific(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super N> type, FormatConfiguration format) Create a more specific deserializer for the given definition and format configuration.default Serializer<N> createSpecific(Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends N> type) Create a more specific serializer for the given definition.default Serializer<N> createSpecific(Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends N> type, FormatConfiguration format) Create a more specific serializer for the given definition and format configuration.default voidencodeNumber(Encoder encoder, Number value) Encode the given number.Methods inherited from interface Deserializer
deserialize, deserializeNullable, getDefaultValueMethods inherited from interface Serializer
isAbsent, isDefault, isEmpty, serialize
-
Method Details
-
encodeNumber
Encode the given number.- Parameters:
encoder- The encodervalue- The number value- Throws:
IOException- If an I/O error occurs- Since:
- 3.0
-
createSpecific
default Deserializer<N> createSpecific(Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super N> context) throws SerdeException Description copied from interface:DeserializerCreate a new child deserializer or return this if non is necessary for the given context.- Specified by:
createSpecificin interfaceDeserializer<N extends Number>- Parameters:
decoderContext- The decoder contextcontext- The context, including any annotation metadata and type information to narrow the deserializer type- Returns:
- An instance of the same type of deserializer
- Throws:
SerdeException
-
createSpecific
default Deserializer<N> createSpecific(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super N> 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<N extends Number>- 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
-
createSpecific
default Serializer<N> createSpecific(Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends N> type) throws SerdeException Description copied from interface:SerializerCreate a more specific serializer for the given definition.- Specified by:
createSpecificin interfaceSerializer<N extends Number>- Parameters:
context- The encoder contexttype- The type definition including any annotation metadata- Returns:
- The more specific serializer
- Throws:
SerdeException
-
createSpecific
default Serializer<N> createSpecific(Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends N> type, FormatConfiguration format) throws SerdeException Description copied from interface:FormattedSerializerCreate a more specific serializer for the given definition and format configuration.- Specified by:
createSpecificin interfaceFormattedSerializer<N extends Number>- Parameters:
context- The encoder contexttype- The type definition including any annotation metadataformat- The format configuration- Returns:
- The more specific serializer
- Throws:
SerdeException- If the serializer cannot be selected
-