Class 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 Detail

      • deserialize

        public <T> T deserialize​(InputStream inputStream,
                                 com.azure.core.util.serializer.TypeReference<T> typeReference)
        Deserializes the inputStream into a strongly-typed object.
        Specified by:
        deserialize in interface com.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 then null is returned.
        Throws:
        NullPointerException - if typeReference is null.
      • deserializeAsync

        public <T> Mono<T> deserializeAsync​(InputStream inputStream,
                                            com.azure.core.util.serializer.TypeReference<T> typeReference)
        Deserializes the inputStream into a strongly-typed object.
        Specified by:
        deserializeAsync in interface com.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 - if typeReference is null.
      • serialize

        public void serialize​(OutputStream outputStream,
                              Object object)
        Serializes the object into the outputStream.
        Specified by:
        serialize in interface com.azure.core.util.serializer.ObjectSerializer
        Parameters:
        outputStream - Output stream to write serialization of object to.
        object - The object to serialize into outputStream.
        Throws:
        NullPointerException - if outputStream or object is null.
      • serializeAsync

        public Mono<Void> serializeAsync​(OutputStream outputStream,
                                         Object object)
        Serializes the object into the outputStream.
        Specified by:
        serializeAsync in interface com.azure.core.util.serializer.ObjectSerializer
        Parameters:
        outputStream - Output stream to write serialization of object to.
        object - The object to serialize into outputStream.
        Returns:
        A Mono that completes when the object has been serialized into the stream.
        Throws:
        NullPointerException - if outputStream or object is null.