Interface PObject

All Known Implementing Classes:
PAbstractObject, PJsonObject, PMultiObject, PYamlObject

public interface PObject
Object wrapper interface for Json and Yaml parsing.
  • Method Details

    • opt

      Object opt(String key)
      Get the value for the key.
      Parameters:
      key - the key identifying the value to obtain.
    • getString

      String getString(String key)
      Get a property as a string or throw an exception.
      Parameters:
      key - the property name
    • optString

      String optString(String key)
      Get a property as a string or null.
      Parameters:
      key - the property name
    • optString

      String optString(String key, String defaultValue)
      Get a property as a string or defaultValue.
      Parameters:
      key - the property name
      defaultValue - the default value
    • getInt

      int getInt(String key)
      Get a property as a int or throw an exception.
      Parameters:
      key - the property name
    • optInt

      Integer optInt(String key)
      Get a property as a int or MIN_VALUE.
      Parameters:
      key - the property name
    • optInt

      Integer optInt(String key, Integer defaultValue)
      Get a property as a int or default value.
      Parameters:
      key - the property name
      defaultValue - the default value
    • getLong

      long getLong(String key)
      Get a property as a long or throw an exception.
      Parameters:
      key - the property name
    • optLong

      Long optLong(String key)
      Get a property as a long or MIN_VALUE.
      Parameters:
      key - the property name
    • optLong

      long optLong(String key, long defaultValue)
      Get a property as a long or default value.
      Parameters:
      key - the property name
      defaultValue - the default value
    • getDouble

      double getDouble(String key)
      Get a property as a double or throw an exception.
      Parameters:
      key - the property name
    • optDouble

      Double optDouble(String key)
      Get a property as a double or defaultValue.
      Parameters:
      key - the property name
    • optDouble

      Double optDouble(String key, Double defaultValue)
      Get a property as a double or defaultValue.
      Parameters:
      key - the property name
      defaultValue - the default value
    • getFloat

      float getFloat(String key)
      Get a property as a float or throw an exception.
      Parameters:
      key - the property name
    • optFloat

      Float optFloat(String key)
      Get a property as a float or null.
      Parameters:
      key - the property name
    • optFloat

      Float optFloat(String key, Float defaultValue)
      Get a property as a float or Default value.
      Parameters:
      key - the property name
      defaultValue - default value
    • getBool

      boolean getBool(String key)
      Get a property as a boolean or throw exception.
      Parameters:
      key - the property name
    • optBool

      Boolean optBool(String key)
      Get a property as a boolean or null.
      Parameters:
      key - the property name
    • optBool

      Boolean optBool(String key, Boolean defaultValue)
      Get a property as a boolean or default value.
      Parameters:
      key - the property name
      defaultValue - the default
    • getObject

      PObject getObject(String key)
      Get a property as a object or throw exception.
      Parameters:
      key - the property name
    • optObject

      PObject optObject(String key)
      Get a property as a object or null.
      Parameters:
      key - the property name
    • optObject

      PObject optObject(String key, PObject defaultValue)
      Get a property as a object or null.
      Parameters:
      key - the property name
      defaultValue - default
    • getArray

      PArray getArray(String key)
      Get a property as a array or throw exception.
      Parameters:
      key - the property name
    • optArray

      PArray optArray(String key)
      Get a property as a array or null.
      Parameters:
      key - the property name
    • isArray

      boolean isArray(String key)
      Is the property an array.
      Parameters:
      key - the property name
    • optArray

      PArray optArray(String key, PArray defaultValue)
      Get a property as a array or default.
      Parameters:
      key - the property name
      defaultValue - default
    • keys

      Iterator<String> keys()
      Get an iterator of all keys in this objects.
      Returns:
      The keys iterator
    • size

      int size()
      Get the number of properties in this object.
    • has

      boolean has(String key)
      Check if the object has a property with the key.
      Parameters:
      key - key to check for.
    • getPath

      String getPath(String key)
      Gets the string representation of the path to the current element.
      Parameters:
      key - the leaf key
    • getCurrentPath

      String getCurrentPath()
      Gets the string representation of the path to the current element.