Interface OutputJsonObject

All Superinterfaces:
jakarta.json.JsonStructure, jakarta.json.JsonValue, Map<String,Object>
All Known Implementing Classes:
UserFriendlyJsonObject

public interface OutputJsonObject extends jakarta.json.JsonStructure, Map<String,Object>
Equivalent to the JsonObject, but implementing the Map<String, Object> instead of Map<String, JsonValue> to simplify usage as output object in CallFunctionHandler
  • Nested Class Summary

    Nested classes/interfaces inherited from interface jakarta.json.JsonValue

    jakarta.json.JsonValue.ValueType

    Nested classes/interfaces inherited from interface java.util.Map

    Map.Entry<K extends Object,V extends Object>
  • Field Summary

    Fields inherited from interface jakarta.json.JsonValue

    EMPTY_JSON_ARRAY, EMPTY_JSON_OBJECT, FALSE, NULL, TRUE
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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
    getInt(String name)
    A convenience method for getJsonNumber(name).intValue()
    int
    getInt(String name, int defaultValue)
    Returns the int value of the associated JsonNumber mapping for the specified name.
    jakarta.json.JsonArray
    Returns the array value to which the specified name is mapped.
    jakarta.json.JsonNumber
    Returns the number value to which the specified name is mapped.
    jakarta.json.JsonObject
    Returns the object value to which the specified name is mapped.
    jakarta.json.JsonString
    Returns the string value to which the specified name is mapped.
    A convenience method for getJsonString(name).getString()
    getString(String name, String defaultValue)
    Returns the string value of the associated JsonString mapping for the specified name.
    boolean
    isNull(String name)
    Returns true if the associated value for the specified name is JsonValue.NULL.

    Methods inherited from interface jakarta.json.JsonStructure

    getValue

    Methods inherited from interface jakarta.json.JsonValue

    asJsonArray, asJsonObject, getValueType, toString
  • Method Details

    • getJsonArray

      jakarta.json.JsonArray getJsonArray(String name)
      Returns the array value to which the specified name is mapped. This is a convenience method for (JsonArray)get(name) to get the value.
      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
      Throws:
      ClassCastException - if the value to which the specified name is mapped is not assignable to JsonArray type
    • getJsonObject

      jakarta.json.JsonObject getJsonObject(String name)
      Returns the object value to which the specified name is mapped. This is a convenience method for (JsonObject)get(name) to get the value.
      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
      Throws:
      ClassCastException - if the value to which the specified name is mapped is not assignable to JsonObject type
    • getJsonNumber

      jakarta.json.JsonNumber getJsonNumber(String name)
      Returns the number value to which the specified name is mapped. This is a convenience method for (JsonNumber)get(name) to get the value.
      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
      Throws:
      ClassCastException - if the value to which the specified name is mapped is not assignable to JsonNumber type
    • getJsonString

      jakarta.json.JsonString getJsonString(String name)
      Returns the string value to which the specified name is mapped. This is a convenience method for (JsonString)get(name) to get the value.
      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
      Throws:
      ClassCastException - if the value to which the specified name is mapped is not assignable to JsonString type
    • getString

      String getString(String name)
      A convenience method for getJsonString(name).getString()
      Parameters:
      name - whose associated value is to be returned as String
      Returns:
      the String value to which the specified name is mapped
      Throws:
      NullPointerException - if the specified name doesn't have any mapping
      ClassCastException - if the value for specified name mapping is not assignable to JsonString
    • getString

      String getString(String name, String defaultValue)
      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.
      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

      int getInt(String name)
      A convenience method for getJsonNumber(name).intValue()
      Parameters:
      name - whose associated value is to be returned as int
      Returns:
      the int value to which the specified name is mapped
      Throws:
      NullPointerException - if the specified name doesn't have any mapping
      ClassCastException - if the value for specified name mapping is not assignable to JsonNumber
    • getInt

      int getInt(String name, int defaultValue)
      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.
      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

      boolean getBoolean(String name)
      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.
      Parameters:
      name - whose associated value is to be returned as boolean
      Returns:
      the boolean value to which the specified name is mapped
      Throws:
      NullPointerException - if the specified name doesn't have any mapping
      ClassCastException - if the value for specified name mapping is not assignable to JsonValue.TRUE or JsonValue.FALSE
    • getBoolean

      boolean getBoolean(String name, boolean defaultValue)
      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.
      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

      boolean isNull(String name)
      Returns true if the associated value for the specified name is JsonValue.NULL.
      Parameters:
      name - name whose associated value is checked
      Returns:
      return true if the associated value is JsonValue.NULL, otherwise false
      Throws:
      NullPointerException - if the specified name doesn't have any mapping