public interface JsonObject extends JsonStructure, Map<String,JsonValue>
{ "name":"karl", "age":38, "address": { "street":"dummystreet" "housenumber":12 } }A JsonObject is always also a Map which uses the attribute names as key mapping to their JsonValues.
JsonValue.ValueType
EMPTY_JSON_ARRAY, EMPTY_JSON_OBJECT, FALSE, NULL, TRUE
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean(String name) |
boolean |
getBoolean(String name,
boolean defaultValue) |
int |
getInt(String name) |
int |
getInt(String name,
int defaultValue) |
JsonArray |
getJsonArray(String name) |
JsonNumber |
getJsonNumber(String name) |
JsonObject |
getJsonObject(String name) |
JsonString |
getJsonString(String name) |
String |
getString(String name) |
String |
getString(String name,
String defaultValue) |
boolean |
isNull(String name) |
getValue
asJsonArray, asJsonObject, getValueType, toString
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
JsonArray getJsonArray(String name)
null
if there is no attribute with that nameClassCastException
- if the JsonValue cannot be correctly castJsonObject getJsonObject(String name)
null
if there is no attribute with that nameClassCastException
- if the JsonValue cannot be correctly castJsonNumber getJsonNumber(String name)
null
if there is no attribute with that nameClassCastException
- if the JsonValue cannot be correctly castJsonString getJsonString(String name)
null
if there is no attribute with that nameClassCastException
- if the JsonValue cannot be correctly castString getString(String name)
null
if there is no attribute with that nameClassCastException
- if the JsonValue cannot be correctly castString getString(String name, String defaultValue)
ClassCastException
- if the JsonValue cannot be correctly castint getInt(String name)
null
if there is no attribute with that nameClassCastException
- if the JsonValue cannot be correctly castNullPointerException
- if an object with the given name doesn't existint getInt(String name, int defaultValue)
ClassCastException
- if the JsonValue cannot be correctly castboolean getBoolean(String name)
null
if there is no attribute with that nameClassCastException
- if the JsonValue cannot be correctly castNullPointerException
- if an object with the given name doesn't existboolean getBoolean(String name, boolean defaultValue)
ClassCastException
- if the JsonValue cannot be correctly castboolean isNull(String name)
JsonValue.NULL
Copyright © 2010 - 2020 Adobe. All Rights Reserved