Class UserFriendlyJsonObject

java.lang.Object
step.artefacts.handlers.UserFriendlyJsonObject
All Implemented Interfaces:
jakarta.json.JsonStructure, jakarta.json.JsonValue, Map<String,Object>, OutputJsonObject

public class UserFriendlyJsonObject extends Object implements OutputJsonObject
  • Constructor Details

    • UserFriendlyJsonObject

      public UserFriendlyJsonObject(jakarta.json.JsonObject wrapped)
  • Method Details

    • unwrapJsonObject

      protected Map<String,Object> unwrapJsonObject(jakarta.json.JsonObject jsonObject)
    • getValue

      public jakarta.json.JsonValue getValue(String jsonPointer)
      Specified by:
      getValue in interface jakarta.json.JsonStructure
    • getValueType

      public jakarta.json.JsonValue.ValueType getValueType()
      Specified by:
      getValueType in interface jakarta.json.JsonValue
    • asJsonObject

      public jakarta.json.JsonObject asJsonObject()
      Specified by:
      asJsonObject in interface jakarta.json.JsonValue
    • asJsonArray

      public jakarta.json.JsonArray asJsonArray()
      Specified by:
      asJsonArray in interface jakarta.json.JsonValue
    • toString

      public String toString()
      Specified by:
      toString in interface jakarta.json.JsonValue
      Overrides:
      toString in class Object
    • getJsonArray

      public jakarta.json.JsonArray getJsonArray(String name)
      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 interface OutputJsonObject
      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

      public jakarta.json.JsonObject getJsonObject(String name)
      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 interface OutputJsonObject
      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

      public jakarta.json.JsonNumber getJsonNumber(String name)
      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 interface OutputJsonObject
      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

      public jakarta.json.JsonString getJsonString(String name)
      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 interface OutputJsonObject
      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

      public String getString(String name)
      Description copied from interface: OutputJsonObject
      A convenience method for getJsonString(name).getString()
      Specified by:
      getString in interface OutputJsonObject
      Parameters:
      name - whose associated value is to be returned as String
      Returns:
      the String value to which the specified name is mapped
    • getString

      public String getString(String name, String defaultValue)
      Description copied from interface: OutputJsonObject
      Returns the string value of the associated JsonString mapping for the specified name. If JsonString is found, then its JsonString.getString() is returned. Otherwise, the specified default value is returned.
      Specified by:
      getString in interface OutputJsonObject
      Parameters:
      name - whose associated value is to be returned as String
      defaultValue - a default value to be returned
      Returns:
      the string value of the associated mapping for the name, or the default value
    • getInt

      public int getInt(String name)
      Description copied from interface: OutputJsonObject
      A convenience method for getJsonNumber(name).intValue()
      Specified by:
      getInt in interface OutputJsonObject
      Parameters:
      name - whose associated value is to be returned as int
      Returns:
      the int value to which the specified name is mapped
    • getInt

      public int getInt(String name, int defaultValue)
      Description copied from interface: OutputJsonObject
      Returns the int value of the associated JsonNumber mapping for the specified name. If JsonNumber is found, then its JsonNumber.intValue() is returned. Otherwise, the specified default value is returned.
      Specified by:
      getInt in interface OutputJsonObject
      Parameters:
      name - whose associated value is to be returned as int
      defaultValue - a default value to be returned
      Returns:
      the int value of the associated mapping for the name, or the default value
    • getBoolean

      public boolean getBoolean(String name)
      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 interface OutputJsonObject
      Parameters:
      name - whose associated value is to be returned as boolean
      Returns:
      the boolean value to which the specified name is mapped
    • getBoolean

      public boolean getBoolean(String name, boolean defaultValue)
      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 interface OutputJsonObject
      Parameters:
      name - whose associated value is to be returned as int
      defaultValue - a default value to be returned
      Returns:
      the boolean value of the associated mapping for the name, or the default value
    • isNull

      public boolean isNull(String name)
      Description copied from interface: OutputJsonObject
      Returns true if the associated value for the specified name is JsonValue.NULL.
      Specified by:
      isNull in interface OutputJsonObject
      Parameters:
      name - name whose associated value is checked
      Returns:
      return true if the associated value is JsonValue.NULL, otherwise false
    • size

      public int size()
      Specified by:
      size in interface Map<String,Object>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<String,Object>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<String,Object>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<String,Object>
    • get

      public Object get(Object key)
      Specified by:
      get in interface Map<String,Object>
    • put

      public Object put(String key, Object value)
      Specified by:
      put in interface Map<String,Object>
    • remove

      public Object remove(Object key)
      Specified by:
      remove in interface Map<String,Object>
    • putAll

      public void putAll(Map<? extends String,? extends Object> m)
      Specified by:
      putAll in interface Map<String,Object>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<String,Object>
    • keySet

      public Set<String> keySet()
      Specified by:
      keySet in interface Map<String,Object>
    • values

      public Collection<Object> values()
      Specified by:
      values in interface Map<String,Object>
    • entrySet

      public Set<Map.Entry<String,Object>> entrySet()
      Specified by:
      entrySet in interface Map<String,Object>