Class TestJsonObject

java.lang.Object
test.de.iip_ecosphere.platform.support.json.TestJsonObject
All Implemented Interfaces:
de.iip_ecosphere.platform.support.json.JsonObject, de.iip_ecosphere.platform.support.json.JsonValue

class TestJsonObject extends Object implements de.iip_ecosphere.platform.support.json.JsonObject
Wraps an EE JsonObject (provided by Jersey).
Author:
Holger Eichelberger, SSE
  • Field Details

    • object

      private javax.json.JsonObject object
  • Constructor Details

    • TestJsonObject

      TestJsonObject(javax.json.JsonObject object)
      Creates a wrapping JSON object.
      Parameters:
      object - the JSON object to wrap
  • Method Details

    • createObject

      static de.iip_ecosphere.platform.support.json.JsonObject createObject(Reader reader) throws IOException
      Creates a JSON object for individual access from reader.
      Parameters:
      reader - the reader
      Returns:
      the JSON object
      Throws:
      IOException - if the object cannot be read/constructed
    • createObjectBuilder

      static de.iip_ecosphere.platform.support.json.JsonObjectBuilder createObjectBuilder()
      Creates a JSON object builder.
      Returns:
      the JSON object builder
    • createArrayBuilder

      static de.iip_ecosphere.platform.support.json.JsonArrayBuilder createArrayBuilder()
      Creates a JSON array builder.
      Returns:
      the JSON array builder
    • getJsonObject

      public de.iip_ecosphere.platform.support.json.JsonObject getJsonObject(String name)
      Specified by:
      getJsonObject in interface de.iip_ecosphere.platform.support.json.JsonObject
    • getJsonArray

      public de.iip_ecosphere.platform.support.json.JsonArray getJsonArray(String name)
      Specified by:
      getJsonArray in interface de.iip_ecosphere.platform.support.json.JsonObject
    • getJsonNumber

      public de.iip_ecosphere.platform.support.json.JsonNumber getJsonNumber(String name)
      Specified by:
      getJsonNumber in interface de.iip_ecosphere.platform.support.json.JsonObject
    • getJsonString

      public de.iip_ecosphere.platform.support.json.JsonString getJsonString(String name)
      Specified by:
      getJsonString in interface de.iip_ecosphere.platform.support.json.JsonObject
    • getValue

      public de.iip_ecosphere.platform.support.json.JsonValue getValue(String name)
      Specified by:
      getValue in interface de.iip_ecosphere.platform.support.json.JsonObject
    • getString

      public String getString(String name)
      Specified by:
      getString in interface de.iip_ecosphere.platform.support.json.JsonObject
    • getInt

      public int getInt(String name)
      Specified by:
      getInt in interface de.iip_ecosphere.platform.support.json.JsonObject
    • getBoolean

      public boolean getBoolean(String name)
      Specified by:
      getBoolean in interface de.iip_ecosphere.platform.support.json.JsonObject
    • isNull

      public boolean isNull(String name)
      Specified by:
      isNull in interface de.iip_ecosphere.platform.support.json.JsonObject
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface de.iip_ecosphere.platform.support.json.JsonObject
    • map

      static de.iip_ecosphere.platform.support.json.JsonValue map(javax.json.JsonValue value)
      Maps an implementation value to an abstracted value.
      Parameters:
      value - the implementation value (may be null)
      Returns:
      the abstracted value (may be null)
    • keys

      public Set<String> keys()
      Specified by:
      keys in interface de.iip_ecosphere.platform.support.json.JsonObject
    • asJsonObject

      public de.iip_ecosphere.platform.support.json.JsonObject asJsonObject()
      Specified by:
      asJsonObject in interface de.iip_ecosphere.platform.support.json.JsonValue
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • containsKey

      public boolean containsKey(String key)
      Specified by:
      containsKey in interface de.iip_ecosphere.platform.support.json.JsonObject