Class AvroJsonCodec<T>

  • All Implemented Interfaces:
    Codec<T>

    public class AvroJsonCodec<T>
    extends Object
    implements Codec<T>
    JSON Avro format for debugging purpose.
    Since:
    10.2
    • Field Detail

      • messageClass

        protected final Class<T> messageClass
      • schema

        protected final org.apache.avro.Schema schema
      • writer

        protected final org.apache.avro.reflect.ReflectDatumWriter<T> writer
      • reader

        protected final org.apache.avro.reflect.ReflectDatumReader<T> reader
    • Constructor Detail

      • AvroJsonCodec

        public AvroJsonCodec​(Class<T> messageClass)
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Codec
        Returns the codec name
        Specified by:
        getName in interface Codec<T>
      • encode

        public byte[] encode​(T object)
        Description copied from interface: Codec
        Encodes the object returns a byte array representation.
        Specified by:
        encode in interface Codec<T>
      • decode

        public T decode​(byte[] data)
        Description copied from interface: Codec
        Decodes the byte array returns an object.
        Specified by:
        decode in interface Codec<T>