public static interface Json.Object
string->value map.| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(java.lang.String key)
Returns true if this object contains a value at the specified key, false if not.
|
Json.Array |
getArray(java.lang.String key)
Gets the array value at the given key, or
null if there is no value at this key. |
<T> Json.TypedArray<T> |
getArray(java.lang.String key,
java.lang.Class<T> jsonType)
Gets an array at the given key that assumes its values are of the given json type, or
null if there is no value at this key. |
<T> Json.TypedArray<T> |
getArray(java.lang.String key,
java.lang.Class<T> jsonType,
Json.TypedArray<T> dflt)
Gets an array at the given key that assumes its values are of the given json type, or the
default if there is no value at this key.
|
Json.Array |
getArray(java.lang.String key,
Json.Array dflt)
Gets the array value at the given key, or the default if there is no value at this key.
|
boolean |
getBoolean(java.lang.String key)
Gets the boolean value at the given key, or
false if there is no value at this
key. |
boolean |
getBoolean(java.lang.String key,
boolean dflt)
Gets the boolean value at the given key, or the default if there is no value at this key.
|
double |
getDouble(java.lang.String key)
Gets the double value at the given key, or
0 if there is no value at this key. |
double |
getDouble(java.lang.String key,
double dflt)
Gets the double value at the given key, or the default if there is no value at this key.
|
int |
getInt(java.lang.String key)
Gets the integer value at the given key, or
0 if there is no value at this key. |
int |
getInt(java.lang.String key,
int dflt)
Gets the integer value at the given key, or the default if there is no value at this key.
|
long |
getLong(java.lang.String key)
Gets the long value at the given key, or
0 if there is no value at this key. |
long |
getLong(java.lang.String key,
long dflt)
Gets the long value at the given key, or the default if there is no value at this key.
|
float |
getNumber(java.lang.String key)
Gets the float value at the given key, or
0 if there is no value at this key. |
float |
getNumber(java.lang.String key,
float dflt)
Gets the float value at the given key, or the default if there is no value at this key.
|
Json.Object |
getObject(java.lang.String key)
Gets the object value at the given key, or
null if there is no value at this
key. |
Json.Object |
getObject(java.lang.String key,
Json.Object dflt)
Gets the object value at the given key, or the default if there is no value at this key.
|
java.lang.String |
getString(java.lang.String key)
Gets the string value at the given key, or
null if there is no value at this
key. |
java.lang.String |
getString(java.lang.String key,
java.lang.String dflt)
Gets the string value at the given key, or the default if there is no value at this key.
|
boolean |
isArray(java.lang.String key)
Returns
true if the value at the given key is an array. |
boolean |
isBoolean(java.lang.String key)
Returns
true if the value at the given key is a boolean. |
boolean |
isNull(java.lang.String key)
Returns
true if the value at the given key is null or does not exist. |
boolean |
isNumber(java.lang.String key)
Returns
true if the value at the given key is a number. |
boolean |
isObject(java.lang.String key)
Returns
true if the value at the given key is an object. |
boolean |
isString(java.lang.String key)
Returns
true if the value at the given key is a string. |
Json.TypedArray<java.lang.String> |
keys()
Gets a snapshot of the current set of keys for this JSON object.
|
Json.Object |
put(java.lang.String key,
java.lang.Object value)
Inserts a JSON null, object, array or string value at the given key.
|
Json.Object |
remove(java.lang.String key)
Removes a JSON value at the given key.
|
<T extends playn.core.json.JsonSink<T>> |
write(playn.core.json.JsonSink<T> sink)
Writes this object to a
JsonSink. |
boolean getBoolean(java.lang.String key)
false if there is no value at this
key.boolean getBoolean(java.lang.String key,
boolean dflt)
float getNumber(java.lang.String key)
0 if there is no value at this key.float getNumber(java.lang.String key,
float dflt)
double getDouble(java.lang.String key)
0 if there is no value at this key.double getDouble(java.lang.String key,
double dflt)
int getInt(java.lang.String key)
0 if there is no value at this key.int getInt(java.lang.String key,
int dflt)
long getLong(java.lang.String key)
0 if there is no value at this key.
NOTE: this is not accurate on the HTML backend as all numbers are represented as
doubles, which cannot represent all possible long values. This is included for projects that
use only the other backends and need long values.long getLong(java.lang.String key,
long dflt)
java.lang.String getString(java.lang.String key)
null if there is no value at this
key.java.lang.String getString(java.lang.String key,
java.lang.String dflt)
Json.Object getObject(java.lang.String key)
null if there is no value at this
key.Json.Object getObject(java.lang.String key, Json.Object dflt)
Json.Array getArray(java.lang.String key)
null if there is no value at this key.Json.Array getArray(java.lang.String key, Json.Array dflt)
<T> Json.TypedArray<T> getArray(java.lang.String key, java.lang.Class<T> jsonType)
null if there is no value at this key.jsonType - one of Json.Object, Json.Array, Boolean, Integer, Float, Double, or Stringjava.lang.IllegalArgumentException - if jsonType is of an invalid type.<T> Json.TypedArray<T> getArray(java.lang.String key, java.lang.Class<T> jsonType, Json.TypedArray<T> dflt)
jsonType - one of Json.Object, Json.Array, Boolean, Integer, Float, Double, or Stringdflt - An existing typed arrayjava.lang.IllegalArgumentException - if jsonType is of an invalid type.boolean containsKey(java.lang.String key)
Json.TypedArray<java.lang.String> keys()
boolean isArray(java.lang.String key)
true if the value at the given key is an array.boolean isBoolean(java.lang.String key)
true if the value at the given key is a boolean.boolean isNull(java.lang.String key)
true if the value at the given key is null or does not exist.boolean isNumber(java.lang.String key)
true if the value at the given key is a number.boolean isString(java.lang.String key)
true if the value at the given key is a string.boolean isObject(java.lang.String key)
true if the value at the given key is an object.Json.Object put(java.lang.String key, java.lang.Object value)
Json.Object remove(java.lang.String key)
<T extends playn.core.json.JsonSink<T>> playn.core.json.JsonSink<T> write(playn.core.json.JsonSink<T> sink)
JsonSink.Copyright © 2018. All Rights Reserved.