Class GsonUtils
java.lang.Object
org.aksw.commons.util.gson.GsonUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.gson.JsonElementcopyOrNull(com.google.gson.JsonElement elt) Returns null if the argument is null, otherwise a deep copy.static booleanisNull(com.google.gson.JsonElement elt) Returns true if the argument is either java null or json null.static com.google.gson.JsonObjectCreates fresh empty JSON objects if a key has no valuestatic com.google.gson.JsonObjectstatic com.google.gson.JsonArraymerge(com.google.gson.JsonArray a, com.google.gson.JsonArray b) static com.google.gson.JsonElementmerge(com.google.gson.JsonElement a, com.google.gson.JsonElement b) static com.google.gson.JsonElementmerge(com.google.gson.JsonObject a, com.google.gson.JsonObject b) parsePathSegments(String str) This method is a stub.static com.google.gson.JsonObjectsetElement(com.google.gson.JsonObject obj, List<String> keys, com.google.gson.JsonElement value) Set an element at a given path.static com.google.gson.JsonObjectstatic com.google.gson.JsonObjectSet a string at a given path.
-
Constructor Details
-
GsonUtils
public GsonUtils()
-
-
Method Details
-
setString
-
setNumber
-
setElement
-
makePath
Creates fresh empty JSON objects if a key has no value -
makePath
-
parsePathSegments
-
merge
public static com.google.gson.JsonElement merge(com.google.gson.JsonElement a, com.google.gson.JsonElement b) -
merge
public static com.google.gson.JsonElement merge(com.google.gson.JsonObject a, com.google.gson.JsonObject b) -
merge
public static com.google.gson.JsonArray merge(com.google.gson.JsonArray a, com.google.gson.JsonArray b) -
isNull
public static boolean isNull(com.google.gson.JsonElement elt) Returns true if the argument is either java null or json null. -
copyOrNull
public static com.google.gson.JsonElement copyOrNull(com.google.gson.JsonElement elt) Returns null if the argument is null, otherwise a deep copy.
-