Class ByteArrayToGenericRecordConverter

java.lang.Object
org.axonframework.serialization.avro.ByteArrayToGenericRecordConverter
All Implemented Interfaces:
ContentTypeConverter<byte[],org.apache.avro.generic.GenericRecord>

public class ByteArrayToGenericRecordConverter extends Object implements ContentTypeConverter<byte[],org.apache.avro.generic.GenericRecord>
Content type converter between single-object-encoded bytes and Avro generic record.
Since:
4.11.0
Author:
Simon Zambrovski, Jan Galinski
  • Constructor Summary

    Constructors
    Constructor
    Description
    ByteArrayToGenericRecordConverter(org.apache.avro.message.SchemaStore schemaStore)
    Constructs a content type converter used during deserialization for upcasting, to create GenericRecord from single-object-encoded for a given schema.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.avro.generic.GenericRecord
    convert(byte[] singleObjectEncodeBytes)
    Converts the given object into another.
    Class<byte[]>
    The expected type of input data.
    Class<org.apache.avro.generic.GenericRecord>
    The returned type of IntermediateRepresentation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ByteArrayToGenericRecordConverter

      public ByteArrayToGenericRecordConverter(org.apache.avro.message.SchemaStore schemaStore)
      Constructs a content type converter used during deserialization for upcasting, to create GenericRecord from single-object-encoded for a given schema.
      Parameters:
      schemaStore - schema store to resolve schema from fingerprint.
  • Method Details

    • expectedSourceType

      public Class<byte[]> expectedSourceType()
      Description copied from interface: ContentTypeConverter
      The expected type of input data.
      Specified by:
      expectedSourceType in interface ContentTypeConverter<byte[],org.apache.avro.generic.GenericRecord>
      Returns:
      the expected data format in IntermediateRepresentation
    • targetType

      public Class<org.apache.avro.generic.GenericRecord> targetType()
      Description copied from interface: ContentTypeConverter
      The returned type of IntermediateRepresentation
      Specified by:
      targetType in interface ContentTypeConverter<byte[],org.apache.avro.generic.GenericRecord>
      Returns:
      the output data format in IntermediateRepresentation
    • convert

      public org.apache.avro.generic.GenericRecord convert(byte[] singleObjectEncodeBytes)
      Description copied from interface: ContentTypeConverter
      Converts the given object into another. Typically, these values are contained by a SerializedObject instance.
      Specified by:
      convert in interface ContentTypeConverter<byte[],org.apache.avro.generic.GenericRecord>
      Parameters:
      singleObjectEncodeBytes - the value to convert
      Returns:
      the converted value