public static class JsonRestHandler.JsonHelper extends Object
| Constructor and Description |
|---|
JsonHelper() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.gson.JsonElement |
getJsonElementFromJsonObject(com.google.gson.JsonObject object,
String key)
Returns the
JsonElement associated to the given key in the provided object. |
public static com.google.gson.JsonElement getJsonElementFromJsonObject(com.google.gson.JsonObject object,
String key)
JsonElement associated to the given key in the provided object.
This method throws a XatkitException if the key field of the provided JsonObject
is null. The thrown exception can be globally caught to avoid multiple null checks
when manipulating JsonObjects.
object - the JsonObject to retrieve the field ofkey - the identifier of the field in the provided object to retrieveJsonElement associated to the given key in the provided objectXatkitException - if the key field is nullCopyright © 2020 SOM Research Lab. All rights reserved.