Class ApacheAvroSerializerBuilder
java.lang.Object
com.azure.core.serializer.avro.apache.ApacheAvroSerializerBuilder
Fluent builder class that configures and instantiates instances of
ApacheAvroSerializer
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Instantiates a new instance ofApacheAvroSerializer
based on the configurations set on the builder.decoderFactory
(DecoderFactory decoderFactory) Configures theDecoderFactory
that will be used to deserialize the Avro stream into an object.encoderFactory
(EncoderFactory encoderFactory) Configures theEncoderFactory
that will be used to serialize an object into an Avro stream.Configures the schema that will be associated to theApacheAvroSerializer
whenbuild()
is called.specificData
(SpecificData specificData) Configures theSpecificData
that will be used during serialization and deserialization of Avro.
-
Constructor Details
-
ApacheAvroSerializerBuilder
public ApacheAvroSerializerBuilder()
-
-
Method Details
-
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
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
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
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
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.
-