Package io.micronaut.serde
Interface ObjectSerializer<T>
- Type Parameters:
T
- The object type to be serialized
- All Superinterfaces:
Serializer<T>
A variation of
Serializer
that is serializing an object and supports serializing its content into an existing object.- Since:
- 2.3
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.serde.Serializer
Serializer.EncoderContext
-
Method Summary
Modifier and TypeMethodDescriptionvoid
serializeInto
(@NonNull Encoder encoder, @NonNull Serializer.EncoderContext context, @NonNull io.micronaut.core.type.Argument<? extends T> type, T value) Serializes the object values using the passed object encoder.Methods inherited from interface io.micronaut.serde.Serializer
createSpecific, isAbsent, isEmpty, serialize
-
Method Details
-
serializeInto
void serializeInto(@NonNull @NonNull Encoder encoder, @NonNull @NonNull Serializer.EncoderContext context, @NonNull @NonNull io.micronaut.core.type.Argument<? extends T> type, @NonNull T value) throws IOException Serializes the object values using the passed object encoder.- Parameters:
encoder
- The object 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
-