public interface

PayloadSerializer

org.apache.helix.manager.zk.serializer.PayloadSerializer
Known Indirect Subclasses

Class Overview

Interface for converting back and forth between raw bytes and generic objects

Summary

Public Methods
abstract <T> T deserialize(Class<T> clazz, byte[] bytes)
Convert raw bytes to a generic object instance
abstract <T> byte[] serialize(T data)
Convert a generic object instance to raw bytes

Public Methods

public abstract T deserialize (Class<T> clazz, byte[] bytes)

Convert raw bytes to a generic object instance

Parameters
clazz The class represented by the deserialized bytes
bytes byte array representing the object
Returns
  • instance of the generic type or null if the conversion failed

public abstract byte[] serialize (T data)

Convert a generic object instance to raw bytes

Parameters
data instance of the generic type
Returns
  • byte array representing the object