public class CustomClassMapper extends Object

Helper class to convert to/from custom POJO classes and plain Java types.

Public Constructor Summary

Public Method Summary

static <T> T
convertToCustomClass(Object object, Class<T> clazz)
Converts a standard library Java representation of JSON data to an object of the provided class.
static <T> T
convertToCustomClass(Object object, GenericTypeIndicator<T> typeIndicator)
Converts a standard library Java representation of JSON data to an object of the class provided through the GenericTypeIndicator
static Object
convertToPlainJavaTypes(Object object)
Converts a Java representation of JSON data to standard library Java data types: Map, Array, String, Double, Integer and Boolean.
static Map<StringObject>

Inherited Method Summary

Public Constructors

public CustomClassMapper ()

Public Methods

public static T convertToCustomClass (Object object, Class<T> clazz)

Converts a standard library Java representation of JSON data to an object of the provided class.

Parameters
object The representation of the JSON data
clazz The class of the object to convert to
Returns
  • The POJO object.

public static T convertToCustomClass (Object object, GenericTypeIndicator<T> typeIndicator)

Converts a standard library Java representation of JSON data to an object of the class provided through the GenericTypeIndicator

Parameters
object The representation of the JSON data
typeIndicator The indicator providing class of the object to convert to
Returns
  • The POJO object.

public static Object convertToPlainJavaTypes (Object object)

Converts a Java representation of JSON data to standard library Java data types: Map, Array, String, Double, Integer and Boolean. POJOs are converted to Java Maps.

Parameters
object The representation of the JSON data
Returns
  • JSON representation containing only standard library Java types

public static Map<StringObject> convertToPlainJavaTypes (Map<StringObject> update)

Parameters
update