Package jadex.commons
Class Properties
- java.lang.Object
 - 
- jadex.commons.Properties
 
 
- 
public class Properties extends java.lang.ObjectThe configuration properties. 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringidThe id.protected java.lang.StringnameThe name.protected java.util.ListpropertiesThe direct properties.protected java.util.ListsubpropertiesThe subproperties.protected java.lang.StringtypeThe property type (defines the kind of property). 
- 
Constructor Summary
Constructors Constructor Description Properties()Create a new properties.Properties(java.lang.String name, java.lang.String type, java.lang.String id)Create a new properties. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperties(Properties toadd)Add the complete content of another properties.voidaddProperty(Property prop)Add a property to this properties.voidaddSubproperties(Properties props)Add subproperties to this properties.voidaddSubproperties(java.lang.String type, Properties subproperties)Add a subproperties to a properties.static booleangetBooleanProperty(Properties[] props, java.lang.String type)Get a boolean property.booleangetBooleanProperty(java.lang.String type)Get a boolean property.doublegetDoubleProperty(java.lang.String type)Get a double property.java.lang.StringgetId()Get the id.static intgetIntProperty(Properties[] props, java.lang.String type)Get an int property.intgetIntProperty(java.lang.String type)Get an int property.static PropertygetLatestProperty(Properties[] props, java.lang.String type)Get the latest property by type.PropertygetLatestProperty(java.lang.String type)Get the latest property by type.static longgetLongProperty(Properties[] props, java.lang.String type)Get a long property.longgetLongProperty(java.lang.String type)Get a long property.java.lang.StringgetName()Get the name.Property[]getProperties()Get all properties.static Property[]getProperties(Properties[] props, java.lang.String type)Get properties by type.Property[]getProperties(java.lang.String type)Get properties by type.PropertygetProperty(java.lang.String type)Get a properties by type.static java.lang.StringgetStringProperty(Properties[] props, java.lang.String type)Get a string property.java.lang.StringgetStringProperty(java.lang.String type)Get a string property.Properties[]getSubproperties()Get all subproperties.static Properties[]getSubproperties(Properties[] props, java.lang.String type)Get subproperties by type.Properties[]getSubproperties(java.lang.String type)Get subproperties by type.PropertiesgetSubproperty(java.lang.String type)Get a properties by type.java.lang.StringgetType()Get the type.voidremoveSubproperties(java.lang.String type)Remove all subproperties of a given type.voidsetId(java.lang.String id)Set the id.voidsetName(java.lang.String name)Set the name of the properties.voidsetProperties(Property[] properties)Set the properties.voidsetSubproperties(Properties[] subproperties)Set the subproperties.voidsetType(java.lang.String type)Set the type of the properties.java.lang.StringtoString()Get the string representation. 
 - 
 
- 
- 
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. 
 - 
 
- 
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:
 toStringin classjava.lang.Object- Returns:
 - The string representation.
 
 
 - 
 
 -