Package jadex.common

Class Properties

java.lang.Object
jadex.common.Properties

public class Properties extends Object
The configuration properties.
  • Field Details

    • name

      protected String name
      The name.
    • type

      protected String type
      The property type (defines the kind of property).
    • id

      protected String id
      The id.
    • properties

      protected List properties
      The direct properties.
    • subproperties

      protected List subproperties
      The subproperties.
  • Constructor Details

    • Properties

      public Properties()
      Create a new properties.
    • Properties

      public Properties(String name, String type, String id)
      Create a new properties.
  • Method Details

    • getName

      public String getName()
      Get the name.
      Returns:
      The name.
    • setName

      public void setName(String name)
      Set the name of the properties.
    • getType

      public String getType()
      Get the type.
      Returns:
      The type.
    • setType

      public void setType(String type)
      Set the type of the properties.
    • getId

      public String getId()
      Get the id.
      Returns:
      The id.
    • setId

      public void setId(String id)
      Set the id.
    • getProperties

      public Property[] getProperties()
      Get all properties.
    • setProperties

      public void setProperties(Property[] properties)
      Set the properties.
      Parameters:
      properties - The properties.
    • getSubproperties

      public Properties[] getSubproperties()
      Get all subproperties.
    • setSubproperties

      public void setSubproperties(Properties[] subproperties)
      Set the subproperties.
      Parameters:
      subproperties - The subproperties to set.
    • getProperty

      public Property getProperty(String type)
      Get a properties by type.
      Parameters:
      type - The type name.
    • getLatestProperty

      public Property getLatestProperty(String type)
      Get the latest property by type.
      Parameters:
      type - The type name.
    • getProperties

      public Property[] getProperties(String type)
      Get properties by type.
      Parameters:
      type - The type name.
    • getSubproperty

      public Properties getSubproperty(String type)
      Get a properties by type.
      Parameters:
      type - The type name.
    • getSubproperties

      public Properties[] getSubproperties(String type)
      Get subproperties by type.
      Parameters:
      type - The type.
    • addSubproperties

      public void addSubproperties(Properties props)
      Add subproperties to this properties.
    • addSubproperties

      public void addSubproperties(String type, Properties subproperties)
      Add a subproperties to a properties.
    • removeSubproperties

      public void removeSubproperties(String type)
      Remove all subproperties of a given type.
    • addProperty

      public void addProperty(Property prop)
      Add a property to this properties.
    • getBooleanProperty

      public boolean getBooleanProperty(String type)
      Get a boolean property.
      Parameters:
      type - The type.
      Returns:
      Returns false if the property is not set.
    • getLongProperty

      public long getLongProperty(String type)
      Get a long property.
      Parameters:
      type - The type.
      Returns:
      Returns the parsed long value, 0 if not set.
    • getIntProperty

      public int getIntProperty(String type)
      Get an int property.
      Parameters:
      type - The type.
      Returns:
      Returns the parsed int value, 0 if not set.
    • getDoubleProperty

      public double getDoubleProperty(String type)
      Get a double property.
      Parameters:
      type - The type.
      Returns:
      Returns the parsed double value, 0 if not set.
    • getStringProperty

      public String getStringProperty(String type)
      Get a string property.
      Parameters:
      type - The type.
      Returns:
      Returns the string value or null if not set.
    • addProperties

      public void addProperties(Properties toadd)
      Add the complete content of another properties.
    • getBooleanProperty

      public static boolean getBooleanProperty(Properties[] props, String type)
      Get a boolean property.
      Parameters:
      type - The type.
      Returns:
      Returns false if the property is not set.
    • getLongProperty

      public static long getLongProperty(Properties[] props, String type)
      Get a long property.
      Parameters:
      type - The type.
      Returns:
      Returns the parsed long value, 0 if not set.
    • getIntProperty

      public static int getIntProperty(Properties[] props, String type)
      Get an int property.
      Parameters:
      type - The type.
      Returns:
      Returns the parsed int value, 0 if not set.
    • getStringProperty

      public static String getStringProperty(Properties[] props, String type)
      Get a string property.
      Parameters:
      type - The type.
      Returns:
      Returns the string value or null if not set.
    • getLatestProperty

      public static Property getLatestProperty(Properties[] props, String type)
      Get the latest property by type.
      Parameters:
      type - The type name.
    • getSubproperties

      public static Properties[] getSubproperties(Properties[] props, String type)
      Get subproperties by type.
      Parameters:
      type - The type.
    • getProperties

      public static Property[] getProperties(Properties[] props, String type)
      Get properties by type.
      Parameters:
      type - The type.
    • toString

      public String toString()
      Get the string representation.
      Overrides:
      toString in class Object
      Returns:
      The string representation.