Class JSONMetadataSerdeTypeRef<T>
- java.lang.Object
-
- org.apache.pulsar.metadata.cache.impl.JSONMetadataSerdeTypeRef<T>
-
- All Implemented Interfaces:
MetadataSerde<T>
public class JSONMetadataSerdeTypeRef<T> extends java.lang.Object implements MetadataSerde<T>
-
-
Constructor Summary
Constructors Constructor Description JSONMetadataSerdeTypeRef(com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tdeserialize(java.lang.String path, byte[] content, Stat stat)Serialize the object from a byte array.byte[]serialize(java.lang.String paht, T value)Serialize the object into a byte array.
-
-
-
Constructor Detail
-
JSONMetadataSerdeTypeRef
public JSONMetadataSerdeTypeRef(com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
-
-
Method Detail
-
serialize
public byte[] serialize(java.lang.String paht, T value) throws java.io.IOExceptionDescription copied from interface:MetadataSerdeSerialize the object into a byte array.- Specified by:
serializein interfaceMetadataSerde<T>- Parameters:
paht- the path of the object on the metadata storevalue- the object instance- Returns:
- a byte array of the serialized version
- Throws:
java.io.IOException- if the serialization fails
-
deserialize
public T deserialize(java.lang.String path, byte[] content, Stat stat) throws java.io.IOException
Description copied from interface:MetadataSerdeSerialize the object from a byte array.- Specified by:
deserializein interfaceMetadataSerde<T>- Parameters:
path- the path of the object on the metadata storecontent- the content as stored on metadata storestat- theStatmetadata for the object- Returns:
- the deserialized object
- Throws:
java.io.IOException- if the deserialization fails
-
-