Class JacksonAvroSerializerBuilder

java.lang.Object
com.azure.core.serializer.avro.jackson.JacksonAvroSerializerBuilder

public class JacksonAvroSerializerBuilder extends Object
Fluent builder class that configures and instantiates instances of JacksonAvroSerializer.
See Also:
  • Constructor Details

    • JacksonAvroSerializerBuilder

      public JacksonAvroSerializerBuilder()
  • Method Details

    • build

      public AvroSerializer build()
      Instantiates a new instance of JacksonAvroSerializer based on the configurations set on the builder.
      Returns:
      A new instance of JacksonAvroSerializer.
      Throws:
      NullPointerException - If schema is null.
      UncheckedIOException - If schema cannot be parsed.
    • schema

      public JacksonAvroSerializerBuilder schema(String schema)
      Configures the schema that will be associated to the JacksonAvroSerializer when build() is called.
      Parameters:
      schema - Avro schema to associate to the serializer that is built.
      Returns:
      The updated JacksonAvroSerializerBuilder object.
    • avroMapper

      public JacksonAvroSerializerBuilder avroMapper(com.fasterxml.jackson.dataformat.avro.AvroMapper avroMapper)
      Configures the AvroMapper that will be used to serialize objects to Avro streams and deserialize Avro streams to objects.

      If avroMapper is null AvroMapper() will be used.

      Parameters:
      avroMapper - The AvroMapper that will serialize to and deserialize Avro.
      Returns:
      The updated JacksonAvroSerializerBuilder object.