Package step.artefacts.handlers
Class UserFriendlyJsonObject
java.lang.Object
step.artefacts.handlers.UserFriendlyJsonObject
- All Implemented Interfaces:
jakarta.json.JsonStructure
,jakarta.json.JsonValue
,Map<String,
,Object> OutputJsonObject
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.json.JsonValue
jakarta.json.JsonValue.ValueType
-
Field Summary
Fields inherited from interface jakarta.json.JsonValue
EMPTY_JSON_ARRAY, EMPTY_JSON_OBJECT, FALSE, NULL, TRUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjakarta.json.JsonArray
jakarta.json.JsonObject
void
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
getBoolean
(String name) Returns the boolean value of the associated mapping for the specified name.boolean
getBoolean
(String name, boolean defaultValue) Returns the boolean value of the associated mapping for the specified name.int
A convenience method forgetJsonNumber(name).intValue()
int
Returns the int value of the associatedJsonNumber
mapping for the specified name.jakarta.json.JsonArray
getJsonArray
(String name) Returns the array value to which the specified name is mapped.jakarta.json.JsonNumber
getJsonNumber
(String name) Returns the number value to which the specified name is mapped.jakarta.json.JsonObject
getJsonObject
(String name) Returns the object value to which the specified name is mapped.jakarta.json.JsonString
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 associatedJsonString
mapping for the specified name.jakarta.json.JsonValue
jakarta.json.JsonValue.ValueType
boolean
isEmpty()
boolean
Returnstrue
if the associated value for the specified name isJsonValue.NULL
.keySet()
void
int
size()
toString()
unwrapJsonObject
(jakarta.json.JsonObject jsonObject) values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
UserFriendlyJsonObject
public UserFriendlyJsonObject(jakarta.json.JsonObject wrapped)
-
-
Method Details
-
unwrapJsonObject
-
getValue
- Specified by:
getValue
in interfacejakarta.json.JsonStructure
-
getValueType
public jakarta.json.JsonValue.ValueType getValueType()- Specified by:
getValueType
in interfacejakarta.json.JsonValue
-
asJsonObject
public jakarta.json.JsonObject asJsonObject()- Specified by:
asJsonObject
in interfacejakarta.json.JsonValue
-
asJsonArray
public jakarta.json.JsonArray asJsonArray()- Specified by:
asJsonArray
in interfacejakarta.json.JsonValue
-
toString
-
getJsonArray
Description copied from interface:OutputJsonObject
Returns 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:
getJsonArray
in interfaceOutputJsonObject
- Parameters:
name
- the name whose associated value is to be returned- Returns:
- the array value to which the specified name is mapped, or
null
if this object contains no mapping for the name
-
getJsonObject
Description copied from interface:OutputJsonObject
Returns 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:
getJsonObject
in interfaceOutputJsonObject
- Parameters:
name
- the name whose associated value is to be returned- Returns:
- the object value to which the specified name is mapped, or
null
if this object contains no mapping for the name
-
getJsonNumber
Description copied from interface:OutputJsonObject
Returns 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:
getJsonNumber
in interfaceOutputJsonObject
- Parameters:
name
- the name whose associated value is to be returned- Returns:
- the number value to which the specified name is mapped, or
null
if this object contains no mapping for the name
-
getJsonString
Description copied from interface:OutputJsonObject
Returns 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:
getJsonString
in interfaceOutputJsonObject
- Parameters:
name
- the name whose associated value is to be returned- Returns:
- the string value to which the specified name is mapped, or
null
if this object contains no mapping for the name
-
getString
Description copied from interface:OutputJsonObject
A convenience method forgetJsonString(name).getString()
- Specified by:
getString
in interfaceOutputJsonObject
- 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:OutputJsonObject
Returns the string value of the associatedJsonString
mapping for the specified name. IfJsonString
is found, then itsJsonString.getString()
is returned. Otherwise, the specified default value is returned.- Specified by:
getString
in interfaceOutputJsonObject
- 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:OutputJsonObject
A convenience method forgetJsonNumber(name).intValue()
- Specified by:
getInt
in interfaceOutputJsonObject
- 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:OutputJsonObject
Returns the int value of the associatedJsonNumber
mapping for the specified name. IfJsonNumber
is found, then itsJsonNumber.intValue()
is returned. Otherwise, the specified default value is returned.- Specified by:
getInt
in interfaceOutputJsonObject
- 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:OutputJsonObject
Returns 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:
getBoolean
in interfaceOutputJsonObject
- 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:OutputJsonObject
Returns 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:
getBoolean
in interfaceOutputJsonObject
- 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:OutputJsonObject
Returnstrue
if the associated value for the specified name isJsonValue.NULL
.- Specified by:
isNull
in interfaceOutputJsonObject
- Parameters:
name
- name whose associated value is checked- Returns:
- return true if the associated value is
JsonValue.NULL
, otherwise false
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<String,
Object>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
Object>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-