Class JSONMetadataSerdeSimpleType<T>

java.lang.Object
org.apache.pulsar.metadata.cache.impl.JSONMetadataSerdeSimpleType<T>
All Implemented Interfaces:
MetadataSerde<T>

public class JSONMetadataSerdeSimpleType<T> extends Object implements MetadataSerde<T>
  • Constructor Details

    • JSONMetadataSerdeSimpleType

      public JSONMetadataSerdeSimpleType(com.fasterxml.jackson.databind.JavaType typeRef)
  • Method Details

    • serialize

      public byte[] serialize(String path, T value) throws IOException
      Description copied from interface: MetadataSerde
      Serialize the object into a byte array.
      Specified by:
      serialize in interface MetadataSerde<T>
      Parameters:
      path - the path of the object on the metadata store
      value - the object instance
      Returns:
      a byte array of the serialized version
      Throws:
      IOException - if the serialization fails
    • deserialize

      public T deserialize(String path, byte[] content, Stat stat) throws IOException
      Description copied from interface: MetadataSerde
      Serialize the object from a byte array.
      Specified by:
      deserialize in interface MetadataSerde<T>
      Parameters:
      path - the path of the object on the metadata store
      content - the content as stored on metadata store
      stat - the Stat metadata for the object
      Returns:
      the deserialized object
      Throws:
      IOException - if the deserialization fails