Class SchemaRegistryApacheAvroSerializer
- java.lang.Object
-
- com.azure.data.schemaregistry.apacheavro.SchemaRegistryApacheAvroSerializer
-
- All Implemented Interfaces:
com.azure.core.util.serializer.ObjectSerializer
public final class SchemaRegistryApacheAvroSerializer extends Object implements com.azure.core.util.serializer.ObjectSerializer
Schema Registry-based serializer implementation for Avro data format using Apache Avro.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
deserialize(InputStream inputStream, com.azure.core.util.serializer.TypeReference<T> typeReference)
Deserializes theinputStream
into a strongly-typed object.<T> Mono<T>
deserializeAsync(InputStream inputStream, com.azure.core.util.serializer.TypeReference<T> typeReference)
Deserializes theinputStream
into a strongly-typed object.void
serialize(OutputStream outputStream, Object object)
Serializes theobject
into theoutputStream
.Mono<Void>
serializeAsync(OutputStream outputStream, Object object)
Serializes theobject
into theoutputStream
.
-
-
-
Method Detail
-
deserialize
public <T> T deserialize(InputStream inputStream, com.azure.core.util.serializer.TypeReference<T> typeReference)
Deserializes theinputStream
into a strongly-typed object.- Specified by:
deserialize
in interfacecom.azure.core.util.serializer.ObjectSerializer
- Type Parameters:
T
- Strongly typed object.- Parameters:
inputStream
- The stream to read from.typeReference
- Type reference of the strongly-typed object.- Returns:
- The deserialized object. If
inputStream
is null thennull
is returned. - Throws:
NullPointerException
- iftypeReference
is null.
-
deserializeAsync
public <T> Mono<T> deserializeAsync(InputStream inputStream, com.azure.core.util.serializer.TypeReference<T> typeReference)
Deserializes theinputStream
into a strongly-typed object.- Specified by:
deserializeAsync
in interfacecom.azure.core.util.serializer.ObjectSerializer
- Type Parameters:
T
- Strongly typed object.- Parameters:
inputStream
- The stream to read from.typeReference
- Type reference of the strongly-typed object.- Returns:
- A Mono that completes with the deserialized object. If
inputStream
is null, then Mono completes with an empty Mono. - Throws:
NullPointerException
- iftypeReference
is null.
-
serialize
public void serialize(OutputStream outputStream, Object object)
Serializes theobject
into theoutputStream
.- Specified by:
serialize
in interfacecom.azure.core.util.serializer.ObjectSerializer
- Parameters:
outputStream
- Output stream to write serialization ofobject
to.object
- The object to serialize intooutputStream
.- Throws:
NullPointerException
- ifoutputStream
orobject
is null.
-
serializeAsync
public Mono<Void> serializeAsync(OutputStream outputStream, Object object)
Serializes theobject
into theoutputStream
.- Specified by:
serializeAsync
in interfacecom.azure.core.util.serializer.ObjectSerializer
- Parameters:
outputStream
- Output stream to write serialization ofobject
to.object
- The object to serialize intooutputStream
.- Returns:
- A Mono that completes when the object has been serialized into the stream.
- Throws:
NullPointerException
- ifoutputStream
orobject
is null.
-
-