Package jadex.commons

Class Properties


  • public class Properties
    extends java.lang.Object
    The configuration properties.
    • Field Detail

      • name

        protected java.lang.String name
        The name.
      • type

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

        protected java.lang.String id
        The id.
      • properties

        protected java.util.List properties
        The direct properties.
      • subproperties

        protected java.util.List subproperties
        The subproperties.
    • Constructor Detail

      • Properties

        public Properties()
        Create a new properties.
      • Properties

        public Properties​(java.lang.String name,
                          java.lang.String type,
                          java.lang.String id)
        Create a new properties.
    • Method Detail

      • getName

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

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

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

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

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

        public void setId​(java.lang.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​(java.lang.String type)
        Get a properties by type.
        Parameters:
        type - The type name.
      • getLatestProperty

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

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

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

        public Properties[] getSubproperties​(java.lang.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​(java.lang.String type,
                                     Properties subproperties)
        Add a subproperties to a properties.
      • removeSubproperties

        public void removeSubproperties​(java.lang.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​(java.lang.String type)
        Get a boolean property.
        Parameters:
        type - The type.
        Returns:
        Returns false if the property is not set.
      • getLongProperty

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

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

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

        public java.lang.String getStringProperty​(java.lang.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,
                                                 java.lang.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,
                                           java.lang.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,
                                         java.lang.String type)
        Get an int property.
        Parameters:
        type - The type.
        Returns:
        Returns the parsed int value, 0 if not set.
      • getStringProperty

        public static java.lang.String getStringProperty​(Properties[] props,
                                                         java.lang.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,
                                                 java.lang.String type)
        Get the latest property by type.
        Parameters:
        type - The type name.
      • getSubproperties

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

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

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