Class InetAddressSerde
java.lang.Object
io.micronaut.serde.support.serdes.InetAddressSerde
- All Implemented Interfaces:
io.micronaut.core.order.Ordered, Deserializer<InetAddress>, Serde<InetAddress>, Serializer<InetAddress>, DeserializerRegistrar<InetAddress>, SerdeRegistrar<InetAddress>, SerializerRegistrar<InetAddress>
Serde implementation of InetAddress.
This is a based on `com.fasterxml.jackson.databind.ser.std.InetAddressSerializer` which is licenced under the Apache 2.0 licence.-
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_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSpecific(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super InetAddress> type) Create a new child deserializer or return this if non is necessary for the given context.createSpecific(Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends InetAddress> type) Create a more specific serializer for the given definition.deserialize(Decoder decoder, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super InetAddress> type) io.micronaut.core.type.Argument<InetAddress> getType()voidserialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends InetAddress> type, InetAddress 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, isEmpty
-
Constructor Details
-
InetAddressSerde
-
-
Method Details
-
createSpecific
public Deserializer<InetAddress> createSpecific(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super InetAddress> type) 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<InetAddress>- Parameters:
context- The decoder contexttype- 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
public Serializer<InetAddress> createSpecific(Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends InetAddress> type) throws SerdeException Description copied from interface:SerializerCreate a more specific serializer for the given definition.- Specified by:
createSpecificin interfaceSerializer<InetAddress>- Parameters:
context- The encoder contexttype- The type definition including any annotation metadata- Returns:
- The more specific serializer
- Throws:
SerdeException
-
deserialize
public InetAddress deserialize(Decoder decoder, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super InetAddress> type) throws IOException Description copied from interface:Deserializer- Specified by:
deserializein interfaceDeserializer<InetAddress>- Parameters:
decoder- The decoder, nevernullcontext- The decoder context, nevernulltype- The generic type to be deserialized- Returns:
- The deserialized object, never
null. UseDeserializer.deserializeNullable(Decoder, DecoderContext, Argument)when the decoder value can benull. - Throws:
IOException- If an error occurs during deserialization of the object
-
serialize
public void serialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends InetAddress> type, InetAddress value) throws IOException Description copied from interface:SerializerSerializes the given value using the passedEncoder.- Specified by:
serializein interfaceSerializer<InetAddress>- Parameters:
encoder- The encoder to usecontext- The encoder context, nevernulltype- Models the generic type of the valuevalue- The value to serialize, nevernull. Callers should encode null values directly.- Throws:
IOException- If an error occurs during serialization
-
getType
- Specified by:
getTypein interfaceDeserializerRegistrar<InetAddress>- Specified by:
getTypein interfaceSerdeRegistrar<InetAddress>- Specified by:
getTypein interfaceSerializerRegistrar<InetAddress>- Returns:
- The serde argument type
-