Interface ObjectSerializer<T>

Type Parameters:
T - The object type to be serialized
All Superinterfaces:
Serializer<T>

@Indexed(ObjectSerializer.class) public interface ObjectSerializer<T> extends 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
  • Method Details

    • serializeInto

      void serializeInto(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends T> type, T value) throws IOException
      Serializes the object values using the passed object encoder.
      Parameters:
      encoder - The object encoder to use
      context - The encoder context, never null
      type - Models the generic type of the value
      value - The value to serialize, never null. Callers should encode null values directly.
      Throws:
      IOException - If an error occurs during serialization