Package net.infonode.properties.base
Class PropertyGroup
java.lang.Object
net.infonode.properties.base.PropertyGroup
- Direct Known Subclasses:
PropertyMapGroup
A group of properties. The group have a name and a description. It can also have a super group from which it inherit
all it's properties. You can think of a property group as similar to a Java class, and properties similar to class
fields.
-
Constructor Summary
ConstructorsConstructorDescriptionPropertyGroup
(String name, String description) Creates a property group.PropertyGroup
(PropertyGroup superGroup, String name, String description) Creates a property group with a super group. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProperty
(Property property) Add a property to this group.Returns the description for this group.getName()
Returns the name of this group.Property[]
Returns an array with the properties in this group.getProperty
(int index) Returns the property at the index, This does not include properties in super groups.getProperty
(String name) Returns the property with the given name.int
Returns the number of properties in this group.Returns the super group of this group.boolean
hasProperty
(Property property) Returns true if this group or one of it's super groups contains the property.toString()
-
Constructor Details
-
PropertyGroup
Creates a property group.- Parameters:
name
- the name of the groupdescription
- the group description
-
PropertyGroup
Creates a property group with a super group. All properties in the super group will be inherited to this group.- Parameters:
superGroup
- the super group of this groupname
- the name of the groupdescription
- the group description
-
-
Method Details
-
getSuperGroup
Returns the super group of this group.- Returns:
- the super group of this group, null if it has no super group
-
getDescription
Returns the description for this group.- Returns:
- the description for this group
-
getName
Returns the name of this group.- Returns:
- the name of this group
-
addProperty
Add a property to this group.- Parameters:
property
- the property to add
-
getPropertyCount
public int getPropertyCount()Returns the number of properties in this group. This does not include properties in super groups.- Returns:
- the number of properties in this group
-
hasProperty
Returns true if this group or one of it's super groups contains the property.- Parameters:
property
- the property- Returns:
- true if this group or one of it's super groups contains the property
-
getProperty
Returns the property at the index, This does not include properties in super groups.- Parameters:
index
- the property index- Returns:
- the property at the index
-
getProperties
Returns an array with the properties in this group. This does not include properties in super groups.- Returns:
- an array with the properties in this group
-
toString
-
getProperty
Returns the property with the given name. This includes properties in super groups.- Parameters:
name
- the property name- Returns:
- the property with the given name, null if no property was found
-