Package jadex.commons
Class Properties
- java.lang.Object
-
- jadex.commons.Properties
-
public class Properties extends java.lang.Object
The configuration properties.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
id
The id.protected java.lang.String
name
The name.protected java.util.List
properties
The direct properties.protected java.util.List
subproperties
The subproperties.protected java.lang.String
type
The 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 void
addProperties(Properties toadd)
Add the complete content of another properties.void
addProperty(Property prop)
Add a property to this properties.void
addSubproperties(Properties props)
Add subproperties to this properties.void
addSubproperties(java.lang.String type, Properties subproperties)
Add a subproperties to a properties.static boolean
getBooleanProperty(Properties[] props, java.lang.String type)
Get a boolean property.boolean
getBooleanProperty(java.lang.String type)
Get a boolean property.double
getDoubleProperty(java.lang.String type)
Get a double property.java.lang.String
getId()
Get the id.static int
getIntProperty(Properties[] props, java.lang.String type)
Get an int property.int
getIntProperty(java.lang.String type)
Get an int property.static Property
getLatestProperty(Properties[] props, java.lang.String type)
Get the latest property by type.Property
getLatestProperty(java.lang.String type)
Get the latest property by type.static long
getLongProperty(Properties[] props, java.lang.String type)
Get a long property.long
getLongProperty(java.lang.String type)
Get a long property.java.lang.String
getName()
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.Property
getProperty(java.lang.String type)
Get a properties by type.static java.lang.String
getStringProperty(Properties[] props, java.lang.String type)
Get a string property.java.lang.String
getStringProperty(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.Properties
getSubproperty(java.lang.String type)
Get a properties by type.java.lang.String
getType()
Get the type.void
removeSubproperties(java.lang.String type)
Remove all subproperties of a given type.void
setId(java.lang.String id)
Set the id.void
setName(java.lang.String name)
Set the name of the properties.void
setProperties(Property[] properties)
Set the properties.void
setSubproperties(Properties[] subproperties)
Set the subproperties.void
setType(java.lang.String type)
Set the type of the properties.java.lang.String
toString()
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:
toString
in classjava.lang.Object
- Returns:
- The string representation.
-
-