public class

JacksonPayloadSerializer

extends Object
implements PayloadSerializer
java.lang.Object
   ↳ org.apache.helix.manager.zk.serializer.JacksonPayloadSerializer

Class Overview

Serializes and deserializes data of a generic type using Jackson

Summary

Public Constructors
JacksonPayloadSerializer()
Public Methods
<T> T deserialize(Class<T> clazz, byte[] bytes)
Convert raw bytes to a generic object instance
<T> byte[] serialize(T data)
Convert a generic object instance to raw bytes
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.helix.manager.zk.serializer.PayloadSerializer

Public Constructors

public JacksonPayloadSerializer ()

Public Methods

public 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 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