public class BehavedJsonElement extends Object
Modifier and Type | Field and Description |
---|---|
private com.google.gson.JsonElement |
delegate |
private String |
path |
Modifier | Constructor and Description |
---|---|
private |
BehavedJsonElement(String path,
com.google.gson.JsonElement delegate) |
Modifier and Type | Method and Description |
---|---|
static BehavedJsonElement |
enrich(com.google.gson.JsonElement element) |
com.google.gson.JsonElement |
get() |
List<BehavedJsonElement> |
getAsArray() |
Boolean |
getAsBoolean() |
Double |
getAsDouble() |
Integer |
getAsInt() |
Long |
getAsLong() |
List<org.apache.commons.lang3.tuple.Pair<String,BehavedJsonElement>> |
getAsMap() |
Number |
getAsNumber() |
Integer |
getAsRoundedInt() |
String |
getAsString() |
List<String> |
getKeys()
Return the list of keys of this object, if this is a JsonObject
|
String |
getPath() |
boolean |
isNullOrNotFound() |
boolean |
isPathNotFound() |
static BehavedJsonElement |
none() |
static BehavedJsonElement |
parse(String json) |
BehavedJsonElement |
path(String... path)
Returns an object that returns null instead of exception when its methods are called (whether JsonPrimitive or others)
|
String |
toString() |
@Nullable private final com.google.gson.JsonElement delegate
private final String path
public static BehavedJsonElement enrich(@Nullable com.google.gson.JsonElement element)
public static BehavedJsonElement parse(@Nullable String json) throws com.google.gson.JsonSyntaxException
com.google.gson.JsonSyntaxException
public static BehavedJsonElement none()
public BehavedJsonElement path(String... path)
public boolean isPathNotFound()
public String getPath()
public com.google.gson.JsonElement get()
public Integer getAsInt()
public Integer getAsRoundedInt()
public Number getAsNumber()
public Double getAsDouble()
public String getAsString()
public Boolean getAsBoolean()
public Long getAsLong()
public boolean isNullOrNotFound()
public List<BehavedJsonElement> getAsArray()
public List<org.apache.commons.lang3.tuple.Pair<String,BehavedJsonElement>> getAsMap()
public List<String> getKeys()
Copyright © 2020 Play SQL. All rights reserved.