Class ApacheAvroSerializerBuilder
- java.lang.Object
-
- com.azure.core.serializer.avro.apache.ApacheAvroSerializerBuilder
-
public class ApacheAvroSerializerBuilder extends Object
Fluent builder class that configures and instantiates instances ofApacheAvroSerializer
.- See Also:
ApacheAvroSerializer
-
-
Constructor Summary
Constructors Constructor Description ApacheAvroSerializerBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AvroSerializer
build()
Instantiates a new instance ofApacheAvroSerializer
based on the configurations set on the builder.ApacheAvroSerializerBuilder
decoderFactory(DecoderFactory decoderFactory)
Configures theDecoderFactory
that will be used to deserialize the Avro stream into an object.ApacheAvroSerializerBuilder
encoderFactory(EncoderFactory encoderFactory)
Configures theEncoderFactory
that will be used to serialize an object into an Avro stream.ApacheAvroSerializerBuilder
schema(String schema)
Configures the schema that will be associated to theApacheAvroSerializer
whenbuild()
is called.ApacheAvroSerializerBuilder
specificData(SpecificData specificData)
Configures theSpecificData
that will be used during serialization and deserialization of Avro.
-
-
-
Method Detail
-
build
public AvroSerializer build()
Instantiates a new instance ofApacheAvroSerializer
based on the configurations set on the builder.- Returns:
- A new instance of
ApacheAvroSerializer
. - Throws:
NullPointerException
- Ifschema
isnull
.
-
schema
public ApacheAvroSerializerBuilder schema(String schema)
Configures the schema that will be associated to theApacheAvroSerializer
whenbuild()
is called.- Parameters:
schema
- Avro schema to associate to the serializer that is built.- Returns:
- The updated ApacheAvroSerializerBuilder object.
-
decoderFactory
public ApacheAvroSerializerBuilder decoderFactory(DecoderFactory decoderFactory)
Configures theDecoderFactory
that will be used to deserialize the Avro stream into an object.If
decoderFactory
isnull
whenbuild()
is calledDecoderFactory.get()
will be used as the decoder factory.- Parameters:
decoderFactory
- TheDecoderFactory
used to deserialize the Avro stream into an object.- Returns:
- The updated ApacheAvroSerializerBuilder object.
-
encoderFactory
public ApacheAvroSerializerBuilder encoderFactory(EncoderFactory encoderFactory)
Configures theEncoderFactory
that will be used to serialize an object into an Avro stream.If
encoderFactory
isnull
whenbuild()
is calledEncoderFactory.get()
will be used as the encoder factory.- Parameters:
encoderFactory
- TheEncoderFactory
used to serialize an object into an Avro stream.- Returns:
- The updated ApacheAvroSerializerBuilder object.
-
specificData
public ApacheAvroSerializerBuilder specificData(SpecificData specificData)
Configures theSpecificData
that will be used during serialization and deserialization of Avro.If
specificData
isnull
whenbuild()
is calledSpecificData.get()
will be used as the generic data.- Parameters:
specificData
- TheSpecificData
used during serialization and deserialization of Avro.- Returns:
- The updated ApacheAvroSerializerBuilder object.
-
-