Class JsonUtil
- java.lang.Object
-
- org.apache.bookkeeper.common.util.JsonUtil
-
public class JsonUtil extends java.lang.ObjectUtil class which helps to parse Json to and from Object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonUtil.ParseJsonExceptionA JSON parsing exception.
-
Constructor Summary
Constructors Constructor Description JsonUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TfromJson(java.lang.String jsonStr, java.lang.Class<T> valueType)static java.lang.StringtoJson(java.lang.Object object)
-
-
-
Method Detail
-
toJson
public static java.lang.String toJson(java.lang.Object object) throws JsonUtil.ParseJsonException- Throws:
JsonUtil.ParseJsonException
-
fromJson
public static <T> T fromJson(java.lang.String jsonStr, java.lang.Class<T> valueType) throws JsonUtil.ParseJsonException- Throws:
JsonUtil.ParseJsonException
-
-