public class

DefaultContextSerializer

extends Object
implements ContextSerializer
java.lang.Object
   ↳ org.apache.helix.controller.rebalancer.context.DefaultContextSerializer

Class Overview

Default serializer implementation for RebalancerContexts. Uses the Jackson JSON library to convert to and from strings

Summary

Public Constructors
DefaultContextSerializer()
Public Methods
<T> T deserialize(Class<T> clazz, String string)
Convert raw bytes to a generic object instance
<T> String serialize(T data)
Convert a RebalancerContext object instance to a String
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.helix.controller.rebalancer.context.ContextSerializer

Public Constructors

public DefaultContextSerializer ()

Public Methods

public T deserialize (Class<T> clazz, String string)

Convert raw bytes to a generic object instance

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

public String serialize (T data)

Convert a RebalancerContext object instance to a String

Parameters
data instance of the rebalancer context type
Returns
  • String representing the object