Class JsonSerialisationUtil
- java.lang.Object
-
- uk.gov.gchq.gaffer.serialisation.util.JsonSerialisationUtil
-
public final class JsonSerialisationUtil extends Object
A utility class containing methods relevant to JSON Serialisation and Deserialisation.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getFieldTypeString(Class<?> clazz, Type typeArg)
Get the string representation of a type of a field within a class.static Map<String,String>
getSerialisedFieldClasses(String className)
Gets all the fields and their classes for a given class.static String
getTypeString(Type typeArg)
Get the string representation of a type of an object.
-
-
-
Method Detail
-
getSerialisedFieldClasses
public static Map<String,String> getSerialisedFieldClasses(String className)
Gets all the fields and their classes for a given class.- Parameters:
className
- the class name to find the fields for.- Returns:
- a map of field name to class name
-
getTypeString
public static String getTypeString(Type typeArg)
Get the string representation of a type of an object.- Parameters:
typeArg
- the type of the field.- Returns:
- the type of the field represented as a string.
-
getFieldTypeString
public static String getFieldTypeString(Class<?> clazz, Type typeArg)
Get the string representation of a type of a field within a class.- Parameters:
clazz
- the class containing the field. This is used to try to resolve any generic class argumentstypeArg
- the type of the field.- Returns:
- the type of the field represented as a string.
-
-