Class JsonUtilsCustom


  • public class JsonUtilsCustom
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonUtilsCustom()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T fromJson​(byte[] bytes, Class<T> raw)
      Deserializes the specified Json bytes into an object of the specified class
      static <T> T fromJson​(byte[] bytes, org.gcube.com.fasterxml.jackson.databind.JavaType type)
      Deserializes the specified Json bytes into an object of the specified class
      static <T> T fromJson​(String json, Class<T> raw)
      Deserializes the specified Json bytes into an object of the specified class
      static <T> T fromJson​(String json, org.gcube.com.fasterxml.jackson.databind.JavaType objectType)
      Deserializes the specified Json bytes into an object of the specified class
      static org.gcube.com.fasterxml.jackson.databind.JavaType geListOfObjectsType​(Class<?> classType)  
      static org.gcube.com.fasterxml.jackson.databind.JavaType geListOfObjectsType​(org.gcube.com.fasterxml.jackson.databind.JavaType objectsType)  
      static org.gcube.com.fasterxml.jackson.databind.JavaType geMapOfObjectsType​(Class<?> keyClass, Class<?> valueClass)  
      static org.gcube.com.fasterxml.jackson.databind.JavaType geMapOfObjectsType​(org.gcube.com.fasterxml.jackson.databind.JavaType keyType, org.gcube.com.fasterxml.jackson.databind.JavaType valueType)  
      static org.gcube.com.fasterxml.jackson.databind.JavaType getObjectJT​(Class<?> classType)  
      static org.gcube.com.fasterxml.jackson.databind.JavaType getResponseBeanOfListOfObjectsType​(Class<?> classType)  
      static org.gcube.com.fasterxml.jackson.databind.JavaType getResponseBeanOfListOfObjectsType​(org.gcube.com.fasterxml.jackson.databind.JavaType listOfObjectType)  
      static org.gcube.com.fasterxml.jackson.databind.JavaType getResponseBeanOfObjectsType​(org.gcube.com.fasterxml.jackson.databind.JavaType objectsType)  
      static org.gcube.com.fasterxml.jackson.databind.JavaType getResponseBeansObjectJT​(Class<?> classType)  
      static <T> T responseBeanFromJson​(byte[] bytes, org.gcube.com.fasterxml.jackson.databind.JavaType type)
      Deserializes the specified Json bytes into an object of the specified class
    • Constructor Detail

      • JsonUtilsCustom

        public JsonUtilsCustom()
    • Method Detail

      • getObjectJT

        public static org.gcube.com.fasterxml.jackson.databind.JavaType getObjectJT​(Class<?> classType)
      • getResponseBeansObjectJT

        public static org.gcube.com.fasterxml.jackson.databind.JavaType getResponseBeansObjectJT​(Class<?> classType)
      • getResponseBeanOfObjectsType

        public static org.gcube.com.fasterxml.jackson.databind.JavaType getResponseBeanOfObjectsType​(org.gcube.com.fasterxml.jackson.databind.JavaType objectsType)
      • geListOfObjectsType

        public static org.gcube.com.fasterxml.jackson.databind.JavaType geListOfObjectsType​(Class<?> classType)
      • geListOfObjectsType

        public static org.gcube.com.fasterxml.jackson.databind.JavaType geListOfObjectsType​(org.gcube.com.fasterxml.jackson.databind.JavaType objectsType)
      • geMapOfObjectsType

        public static org.gcube.com.fasterxml.jackson.databind.JavaType geMapOfObjectsType​(Class<?> keyClass,
                                                                                           Class<?> valueClass)
      • geMapOfObjectsType

        public static org.gcube.com.fasterxml.jackson.databind.JavaType geMapOfObjectsType​(org.gcube.com.fasterxml.jackson.databind.JavaType keyType,
                                                                                           org.gcube.com.fasterxml.jackson.databind.JavaType valueType)
      • getResponseBeanOfListOfObjectsType

        public static org.gcube.com.fasterxml.jackson.databind.JavaType getResponseBeanOfListOfObjectsType​(Class<?> classType)
      • getResponseBeanOfListOfObjectsType

        public static org.gcube.com.fasterxml.jackson.databind.JavaType getResponseBeanOfListOfObjectsType​(org.gcube.com.fasterxml.jackson.databind.JavaType listOfObjectType)
      • fromJson

        public static <T> T fromJson​(byte[] bytes,
                                     org.gcube.com.fasterxml.jackson.databind.JavaType type)
                              throws Exception
        Deserializes the specified Json bytes into an object of the specified class
        Type Parameters:
        T - the type of the desired object
        Parameters:
        json - the string from which the object is to be deserialized
        classOfT - the class of T
        Returns:
        an object of type T from the bytes
        Throws:
        Exception - if the deserialization fails
      • responseBeanFromJson

        public static <T> T responseBeanFromJson​(byte[] bytes,
                                                 org.gcube.com.fasterxml.jackson.databind.JavaType type)
                                          throws Exception
        Deserializes the specified Json bytes into an object of the specified class
        Type Parameters:
        T - the type of the desired object
        Parameters:
        json - the string from which the object is to be deserialized
        classOfT - the class of T
        Returns:
        an object of type T from the bytes
        Throws:
        Exception - if the deserialization fails
      • fromJson

        public static <T> T fromJson​(byte[] bytes,
                                     Class<T> raw)
                              throws Exception
        Deserializes the specified Json bytes into an object of the specified class
        Type Parameters:
        T - the type of the desired object
        Parameters:
        json - the string from which the object is to be deserialized
        classOfT - the class of T
        Returns:
        an object of type T from the bytes
        Throws:
        Exception - if the deserialization fails
      • fromJson

        public static <T> T fromJson​(String json,
                                     Class<T> raw)
                              throws Exception
        Deserializes the specified Json bytes into an object of the specified class
        Type Parameters:
        T - the type of the desired object
        Parameters:
        json - the string from which the object is to be deserialized
        raw - the class of T
        Returns:
        an object of type T from the bytes
        Throws:
        Exception - if the deserialization fails
      • fromJson

        public static <T> T fromJson​(String json,
                                     org.gcube.com.fasterxml.jackson.databind.JavaType objectType)
                              throws Exception
        Deserializes the specified Json bytes into an object of the specified class
        Type Parameters:
        T - the type of the desired object
        Parameters:
        json - the string from which the object is to be deserialized
        raw - the class of T
        Returns:
        an object of type T from the bytes
        Throws:
        Exception - if the deserialization fails