Interface JsonData


public interface JsonData
Represents immutable JSON.
  • Method Details

    • isValidJson

      boolean isValidJson()
      Determines if the JSON is valid.
      Returns:
      true if the JSON is valid, otherwise false
    • getJsonObject

      JsonObject getJsonObject()
      Retrieves the top-level JsonObject for the JSON data.

      If the JSON is not valid (for example, isValidJson() returns false) this throws an exception.

      If the top-level value is not a JsonObject, this throws an exception.

      Returns:
      the top-level JsonObject for the JSON data
    • getJsonArray

      JsonArray getJsonArray()
      Retrieves the top-level JsonArray for the JSON data.

      If the JSON is not valid (for example, isValidJson() returns false) this throws an exception.

      If the top-level value is not a JsonArray, this throws an exception.

      Returns:
      the top-level JsonArray for the JSON data