feat: update JsonUtil

add JsonUtil.parseObject to return JsonElement
This commit is contained in:
Frank.R.Wu 2021-11-17 14:50:07 +08:00
parent c1654034ac
commit aa225980fa

View File

@ -48,4 +48,8 @@ public class JsonUtil {
public static JsonObject parseObjectAsJsonObject(Object obj) { public static JsonObject parseObjectAsJsonObject(Object obj) {
return GSON.toJsonTree(obj).getAsJsonObject(); return GSON.toJsonTree(obj).getAsJsonObject();
} }
public static JsonElement parseObject(Object obj) {
return GSON.toJsonTree(obj);
}
} }