Class CustomizedObjectSerializer<T>
java.lang.Object
io.micronaut.serde.support.serializers.CustomizedObjectSerializer<T>
- Type Parameters:
T
- The type to serialize
- All Implemented Interfaces:
Serializer<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.serde.Serializer
Serializer.EncoderContext
-
Constructor Summary
ConstructorDescriptionCustomizedObjectSerializer
(io.micronaut.serde.support.serializers.SerBean<Object> serBean) -
Method Summary
Modifier and TypeMethodDescriptiongetWriteProperties
(io.micronaut.serde.support.serializers.SerBean<Object> serBean) Obtains the write properties for this serializer.final void
serialize
(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends T> type, T 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, wait
Methods inherited from interface io.micronaut.serde.Serializer
createSpecific, isAbsent, isEmpty
-
Constructor Details
-
CustomizedObjectSerializer
-
-
Method Details
-
serialize
public final void serialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends T> type, T value) throws IOException Description copied from interface:Serializer
Serializes the given value using the passedEncoder
.- Specified by:
serialize
in interfaceSerializer<T>
- Parameters:
encoder
- The encoder to usecontext
- The encoder context, nevernull
type
- Models the generic type of the valuevalue
- The value, can benull
- Throws:
IOException
- If an error occurs during serialization
-
getWriteProperties
@NonNull protected @NonNull List<io.micronaut.serde.support.serializers.SerBean.SerProperty<Object,Object>> getWriteProperties(io.micronaut.serde.support.serializers.SerBean<Object> serBean) Obtains the write properties for this serializer.- Parameters:
serBean
- The serialization bean.- Returns:
- The write properties, never
null
-