public class

DefaultStringSerializer

extends Object
implements StringSerializer
java.lang.Object
   ↳ org.apache.helix.controller.serializer.DefaultStringSerializer

Class Overview

Default serializer implementation for converting to/from strings. Uses the Jackson JSON library to do the conversion

Summary

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

Public Constructors

public DefaultStringSerializer ()

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 an object instance to a String

Parameters
data instance of an arbitrary type
Returns
  • String representing the object