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 JsonObject
s.
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 object
XatkitException
- if the key
field is null
Copyright © 2020 SOM Research Lab. All rights reserved.