Class JsonUtils
- java.lang.Object
-
- org.gcube.common.gxrest.response.inbound.JsonUtils
-
public final class JsonUtils extends Object
Manipulation of anGXInboundResponse's content.- Author:
- Manuele Simi (ISTI CNR)
-
-
Constructor Summary
Constructors Constructor Description JsonUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TfromJson(byte[] bytes, Class<T> raw)Deserializes the specified Json bytes into an object of the specified classstatic <T> TfromJson(String json, Class<T> raw)Deserializes the specified Json bytes into an object of the specified class
-
-
-
Method Detail
-
fromJson
public static <T> T fromJson(byte[] bytes, Class<T> raw) throws ExceptionDeserializes 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 deserializedclassOfT- 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 deserializedraw- the class of T- Returns:
- an object of type T from the bytes
- Throws:
Exception- if the deserialization fails
-
-