Class PMultiObject

All Implemented Interfaces:
PObject

public class PMultiObject extends PAbstractObject
Object wrapper for Yaml parsing.
  • Constructor Details

    • PMultiObject

      public PMultiObject(PObject[] objs)
      Constructor.
      Parameters:
      objs - the possible elements
  • Method Details

    • getContext

      public static String getContext(PObject[] objs)
      Build the context name.
      Parameters:
      objs - the objects
      Returns:
      the global context name
    • opt

      public final Object opt(String key)
      Description copied from interface: PObject
      Get the value for the key.
      Parameters:
      key - the key identifying the value to obtain.
    • optString

      public final String optString(String key)
      Description copied from interface: PObject
      Get a property as a string or null.
      Parameters:
      key - the property name
    • optInt

      public final Integer optInt(String key)
      Description copied from interface: PObject
      Get a property as a int or MIN_VALUE.
      Parameters:
      key - the property name
    • optLong

      public final Long optLong(String key)
      Description copied from interface: PObject
      Get a property as a long or MIN_VALUE.
      Parameters:
      key - the property name
    • optDouble

      public final Double optDouble(String key)
      Description copied from interface: PObject
      Get a property as a double or defaultValue.
      Parameters:
      key - the property name
    • optFloat

      public final Float optFloat(String key)
      Description copied from interface: PObject
      Get a property as a float or null.
      Parameters:
      key - the property name
    • optBool

      public final Boolean optBool(String key)
      Description copied from interface: PObject
      Get a property as a boolean or null.
      Parameters:
      key - the property name
    • optObject

      public final PObject optObject(String key)
      Description copied from interface: PObject
      Get a property as a object or null.
      Parameters:
      key - the property name
    • optArray

      public final PArray optArray(String key)
      Description copied from interface: PObject
      Get a property as a array or null.
      Parameters:
      key - the property name
    • isArray

      public final boolean isArray(String key)
      Description copied from interface: PObject
      Is the property an array.
      Parameters:
      key - the property name
    • keys

      public final Iterator<String> keys()
      Description copied from interface: PObject
      Get an iterator of all keys in this objects.
      Returns:
      The keys iterator
    • size

      public final int size()
      Description copied from interface: PObject
      Get the number of properties in this object.
    • has

      public final boolean has(String key)
      Description copied from interface: PObject
      Check if the object has a property with the key.
      Parameters:
      key - key to check for.