Class EmptyObject
- All Implemented Interfaces:
JsonObject, JsonStructure, JsonValue, Serializable, Map<String, JsonValue>
Private implementation of immutable
JsonObject.-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> Nested classes/interfaces inherited from interface JsonValue
JsonValue.ValueType -
Field Summary
FieldsFields inherited from interface JsonValue
EMPTY_JSON_ARRAY, EMPTY_JSON_OBJECT, FALSE, NULL, TRUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentrySet()booleangetBoolean(String name) Returns the boolean value of the associated mapping for the specified name.booleangetBoolean(String name, boolean defaultValue) Returns the boolean value of the associated mapping for the specified name.intA convenience method forgetJsonNumber(name).intValue()intReturns the int value of the associatedJsonNumbermapping for the specified name.getJsonArray(String name) Returns the array value to which the specified name is mapped.getJsonNumber(String name) Returns the number value to which the specified name is mapped.getJsonObject(String name) Returns the object value to which the specified name is mapped.getJsonString(String name) Returns the string value to which the specified name is mapped.A convenience method forgetJsonString(name).getString()Returns the string value of the associatedJsonStringmapping for the specified name.Returns the value type of this JSON value.booleanReturnstrueif the associated value for the specified name isJsonValue.NULL.private ObjectPreserves singleton propertyMethods inherited from class AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, valuesMethods inherited from interface JsonStructure
getValueMethods inherited from interface JsonValue
asJsonArray, asJsonObject, toStringMethods inherited from interface Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDfor serialization- See Also:
-
-
Constructor Details
-
EmptyObject
EmptyObject()Default constructor.
-
-
Method Details
-
entrySet
-
getJsonArray
Description copied from interface:JsonObjectReturns the array value to which the specified name is mapped. This is a convenience method for(JsonArray)get(name)to get the value.- Specified by:
getJsonArrayin interfaceJsonObject- Parameters:
name- the name whose associated value is to be returned- Returns:
- the array value to which the specified name is mapped, or
nullif this object contains no mapping for the name
-
getJsonObject
Description copied from interface:JsonObjectReturns the object value to which the specified name is mapped. This is a convenience method for(JsonObject)get(name)to get the value.- Specified by:
getJsonObjectin interfaceJsonObject- Parameters:
name- the name whose associated value is to be returned- Returns:
- the object value to which the specified name is mapped, or
nullif this object contains no mapping for the name
-
getJsonNumber
Description copied from interface:JsonObjectReturns the number value to which the specified name is mapped. This is a convenience method for(JsonNumber)get(name)to get the value.- Specified by:
getJsonNumberin interfaceJsonObject- Parameters:
name- the name whose associated value is to be returned- Returns:
- the number value to which the specified name is mapped, or
nullif this object contains no mapping for the name
-
getJsonString
Description copied from interface:JsonObjectReturns the string value to which the specified name is mapped. This is a convenience method for(JsonString)get(name)to get the value.- Specified by:
getJsonStringin interfaceJsonObject- Parameters:
name- the name whose associated value is to be returned- Returns:
- the string value to which the specified name is mapped, or
nullif this object contains no mapping for the name
-
getString
Description copied from interface:JsonObjectA convenience method forgetJsonString(name).getString()- Specified by:
getStringin interfaceJsonObject- Parameters:
name- whose associated value is to be returned as String- Returns:
- the String value to which the specified name is mapped
-
getString
Description copied from interface:JsonObjectReturns the string value of the associatedJsonStringmapping for the specified name. IfJsonStringis found, then itsJsonString.getString()is returned. Otherwise, the specified default value is returned.- Specified by:
getStringin interfaceJsonObject- Parameters:
name- whose associated value is to be returned as StringdefaultValue- a default value to be returned- Returns:
- the string value of the associated mapping for the name, or the default value
-
getInt
Description copied from interface:JsonObjectA convenience method forgetJsonNumber(name).intValue()- Specified by:
getIntin interfaceJsonObject- Parameters:
name- whose associated value is to be returned as int- Returns:
- the int value to which the specified name is mapped
-
getInt
Description copied from interface:JsonObjectReturns the int value of the associatedJsonNumbermapping for the specified name. IfJsonNumberis found, then itsJsonNumber.intValue()is returned. Otherwise, the specified default value is returned.- Specified by:
getIntin interfaceJsonObject- Parameters:
name- whose associated value is to be returned as intdefaultValue- a default value to be returned- Returns:
- the int value of the associated mapping for the name, or the default value
-
getBoolean
Description copied from interface:JsonObjectReturns the boolean value of the associated mapping for the specified name. If the associated mapping is JsonValue.TRUE, then returns true. If the associated mapping is JsonValue.FALSE, then returns false.- Specified by:
getBooleanin interfaceJsonObject- Parameters:
name- whose associated value is to be returned as boolean- Returns:
- the boolean value to which the specified name is mapped
-
getBoolean
Description copied from interface:JsonObjectReturns the boolean value of the associated mapping for the specified name. If the associated mapping is JsonValue.TRUE, then returns true. If the associated mapping is JsonValue.FALSE, then returns false. Otherwise, the specified default value is returned.- Specified by:
getBooleanin interfaceJsonObject- Parameters:
name- whose associated value is to be returned as intdefaultValue- a default value to be returned- Returns:
- the boolean value of the associated mapping for the name, or the default value
-
isNull
Description copied from interface:JsonObjectReturnstrueif the associated value for the specified name isJsonValue.NULL.- Specified by:
isNullin interfaceJsonObject- Parameters:
name- name whose associated value is checked- Returns:
- return true if the associated value is
JsonValue.NULL, otherwise false
-
getValueType
Description copied from interface:JsonValueReturns the value type of this JSON value.- Specified by:
getValueTypein interfaceJsonValue- Returns:
- JSON value type
-
readResolve
-