Class JsonSerialisationUtil


  • public final class JsonSerialisationUtil
    extends Object
    A utility class containing methods relevant to JSON Serialisation and Deserialisation.
    • 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 arguments
        typeArg - the type of the field.
        Returns:
        the type of the field represented as a string.