Class JsonObjectWrapper

java.lang.Object
eu.europa.esig.json.JsonObjectWrapper

public class JsonObjectWrapper extends Object
Wraps a com.github.erosb.jsonsKema.JsonObject and provides utility methods for working with it
  • Constructor Details

    • JsonObjectWrapper

      public JsonObjectWrapper(com.github.erosb.jsonsKema.JsonObject jsonObject)
      Default constructor
      Parameters:
      jsonObject - JsonObject
  • Method Details

    • getAsObject

      public JsonObjectWrapper getAsObject(String name)
      Gets a value of the header name as a Json Object. If not present, or not able to convert, returns NULL.
      Parameters:
      name - String header name to get a value for
      Returns:
      JsonObjectWrapper
    • getAsString

      public String getAsString(String name)
      Gets a value of the header name as a String. If not present, or not able to convert, returns NULL.
      Parameters:
      name - String header name to get a value for
      Returns:
      String
    • getAsNumber

      public Number getAsNumber(String name)
      Gets a value of the header name as a Number. If not present, or not able to convert, returns NULL.
      Parameters:
      name - String header name to get a value for
      Returns:
      Number
    • getAsObjectList

      public List<JsonObjectWrapper> getAsObjectList(String name)
      Gets a value of the header name as a List of Json objects. If not present, or not able to convert, returns empty list.
      Parameters:
      name - String header name to get a value for
      Returns:
      a list of JsonObjectWrappers
    • getAsStringList

      public List<String> getAsStringList(String name)
      Gets a value of the header name as a List of Strings. If not present, or not able to convert, returns empty list.
      Parameters:
      name - String header name to get a value for
      Returns:
      a list of Strings
    • isEmpty

      public boolean isEmpty()
      Returns whether the content of the current JSON object is empty or not
      Returns:
      TRUE if the JSON object does not contain any properties, FALSE otherwise
    • getJsonObject

      protected com.github.erosb.jsonsKema.JsonObject getJsonObject()
      Gets the wrapped JSON object
      Returns:
      JsonObject