Package xyz.juandiii.commons.utils
Class ConvertJson
- java.lang.Object
-
- xyz.juandiii.commons.utils.ConvertJson
-
public class ConvertJson extends Object
-
-
Constructor Summary
Constructors Constructor Description ConvertJson()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TfromJson(Object object, Class<T> tClass)Convert JsonObject to Object Classstatic <T> StringtoJson(T obj)Convert Object to string JSONstatic <T> Map<String,Object>toMap(T obj)Convert Object to Map
-
-
-
Method Detail
-
toMap
public static <T> Map<String,Object> toMap(T obj) throws Exception
Convert Object to Map- Parameters:
obj- Object- Returns:
- Object
- Throws:
Exception- Throw exception
-
toJson
public static <T> String toJson(T obj) throws Exception
Convert Object to string JSON- Parameters:
obj- Object- Returns:
- String
- Throws:
Exception- Throw exception
-
-