public class ApacheAvroSerializerBuilder extends Object
ApacheAvroSerializer
.ApacheAvroSerializer
Constructor and Description |
---|
ApacheAvroSerializerBuilder() |
Modifier and Type | Method and Description |
---|---|
AvroSerializer |
build()
Instantiates a new instance of
ApacheAvroSerializer based on the configurations set on the builder. |
ApacheAvroSerializerBuilder |
decoderFactory(DecoderFactory decoderFactory)
Configures the
DecoderFactory that will be used to deserialize the Avro stream into an object. |
ApacheAvroSerializerBuilder |
encoderFactory(EncoderFactory encoderFactory)
Configures the
EncoderFactory that will be used to serialize an object into an Avro stream. |
ApacheAvroSerializerBuilder |
schema(String schema)
Configures the schema that will be associated to the
ApacheAvroSerializer when ApacheAvroSerializerBuilder.build() is
called. |
ApacheAvroSerializerBuilder |
specificData(SpecificData specificData)
Configures the
SpecificData that will be used during serialization and deserialization of Avro. |
public AvroSerializer build()
ApacheAvroSerializer
based on the configurations set on the builder.ApacheAvroSerializer
.NullPointerException
- If schema
is null
.public ApacheAvroSerializerBuilder schema(String schema)
ApacheAvroSerializer
when ApacheAvroSerializerBuilder.build()
is
called.schema
- Avro schema to associate to the serializer that is built.public ApacheAvroSerializerBuilder decoderFactory(DecoderFactory decoderFactory)
DecoderFactory
that will be used to deserialize the Avro stream into an object.
If decoderFactory
is null
when ApacheAvroSerializerBuilder.build()
is called DecoderFactory.get()
will be used as the decoder factory.
decoderFactory
- The DecoderFactory
used to deserialize the Avro stream into an object.public ApacheAvroSerializerBuilder encoderFactory(EncoderFactory encoderFactory)
EncoderFactory
that will be used to serialize an object into an Avro stream.
If encoderFactory
is null
when ApacheAvroSerializerBuilder.build()
is called EncoderFactory.get()
will be used as the encoder factory.
encoderFactory
- The EncoderFactory
used to serialize an object into an Avro stream.public ApacheAvroSerializerBuilder specificData(SpecificData specificData)
SpecificData
that will be used during serialization and deserialization of Avro.
If specificData
is null
when ApacheAvroSerializerBuilder.build()
is called SpecificData.get()
will be used as the generic data.
specificData
- The SpecificData
used during serialization and deserialization of Avro.Copyright © 2021 Microsoft Corporation. All rights reserved.