-
public class Deserializer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDeserializer.Element
-
Field Summary
Fields Modifier and Type Field Description public final static StringPATH_SPLITTER
-
Constructor Summary
Constructors Constructor Description Deserializer(JsonDeserializationContext context, JsonElement jsonElement)
-
Method Summary
Modifier and Type Method Description DeserializerswitchTo(JsonElement jsonElement)DeserializerswitchTo(String jsonElementName)Changes the root JsonElement on which all operations are performed. Deserializer.Element<String>item()Deserializer.Element<String>item(String itemTag)<T> Deserializer.Element<T>item(Class<T> type, String itemTag)Deserializer.Element<String>item(Array<String> tagArray)Looks for specified keys in current JSON object.Checks current JSON object for keys passed as arguments to this method in order that they were specified. <T> Deserializer.Element<T>item(Class<T> type, Array<String> tagArray)static booleanisEmpty(JsonElement jsonElement)-
-
Method Detail
-
switchTo
Deserializer switchTo(JsonElement jsonElement)
-
switchTo
Deserializer switchTo(String jsonElementName)
Changes the root JsonElement on which all operations are performed.
-
item
Deserializer.Element<String> item()
-
item
Deserializer.Element<String> item(String itemTag)
-
item
Deserializer.Element<String> item(Array<String> tagArray)
Looks for specified keys in current JSON object.Checks current JSON object for keys passed as arguments to this method in order that they were specified.If alternative keys are specified than only first one that returned not
{@code null}will be used.Keys passed to this method can be specified as path to that key using predefined divider PATH_SPLITTER.Subset of json pointer standard.Example:
This method will not throughString operatorImageLink = decoder.switchTo(engagementJsonElement).item(String.class, "engagement/operator/operator_picture/url").get();{@code NullPointException}even if key path does not exist.
-
isEmpty
static boolean isEmpty(JsonElement jsonElement)
-
-
-
-