|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rhq.core.domain.configuration.Property
public class Property
The abstract base class for all Configuration
value property types. A property is associated with a specific
getName()
and can contain one or more values. Since a Configuration
represents a hierarchical set of
data, properties can have a parent. For example, if a property is a member of a PropertyList
, it will have a
parent list
.
There are three different types (i.e. subclasses) of properties:
These subclasses are mapped into a single table so referential integrity is easy to maintain.
Maps may only have one value for a given key, while lists may have many and follow Bag rules.
Note that each property can have an optional error message associated with it. This is used typically when the
property is stored in a configuration that is inside a AbstractResourceConfigurationUpdate
object. If a
property failed to get set, this property's error message can be used to indicate why it failed (e.g. the property's
value was out of range or some other validation rule was not followed).
Field Summary | |
---|---|
static String |
QUERY_DELETE_BY_PROPERTY_IDS
|
Constructor Summary | |
---|---|
|
Property()
|
protected |
Property(Property original,
boolean keepId)
|
Method Summary | |
---|---|
protected void |
appendToStringInternals(StringBuilder str)
Subclasses can override this to add things it wants to see in the toString. |
int |
compareTo(Property other)
|
Property |
deepCopy(boolean keepId)
|
boolean |
equals(Object obj)
|
Configuration |
getConfiguration()
Returns the Configuration object where this property can be found. |
String |
getErrorMessage()
If the property value has been detected to be invalid for some reason, this is an error message that describes the error. |
int |
getId()
|
String |
getName()
Returns the name of this property. |
PropertyList |
getParentList()
Returns the parent of this property, assuming this property is a child of a PropertyList . |
PropertyMap |
getParentMap()
Returns the parent of this property, assuming this property is a child of a PropertyMap . |
int |
hashCode()
|
void |
setConfiguration(Configuration configuration)
Sets the Configuration object where this property can be found. |
void |
setErrorMessage(String errorMessage)
|
void |
setId(int id)
|
void |
setName(String name)
Defines the name that this property will be associated with. |
void |
setParentList(PropertyList parentList)
Sets the parent of this property, which will assume this property is a member of a list . |
void |
setParentMap(PropertyMap parentMap)
Sets the parent of this property, which will assume this property is a member of a map . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String QUERY_DELETE_BY_PROPERTY_IDS
Constructor Detail |
---|
public Property()
protected Property(Property original, boolean keepId)
Method Detail |
---|
public int getId()
public void setId(int id)
@NotNull public String getName()
public void setName(@NotNull String name)
name
- the name that this property will be associated withpublic PropertyList getParentList()
PropertyList
.
null
will be returned if this property is not a child of any list.
Note that direct children of the Configuration
object will return null
.
null
public void setParentList(PropertyList parentList)
list
. Set
this to null
if this property is not a child of any list.
parentList
- the parent of this property or null
public PropertyMap getParentMap()
PropertyMap
.
null
will be returned if this property is not a child of any map.
Note that direct children of the Configuration
object will return null
.
null
public void setParentMap(PropertyMap parentMap)
map
. Set
this to null
if this property is not a child of any map.
parentMap
- the parent of this property or null
public Configuration getConfiguration()
Configuration
object where this property can be found. This will be null
if this
property is a child of a PropertyList
or PropertyMap
and not a direct child of the
Configuration
itself.
Configuration
, or null
public void setConfiguration(Configuration configuration)
Configuration
object where this property can be found. Set this to null
if this
property is a child of a PropertyList
or PropertyMap
and not a direct child of the
Configuration
itself.
configuration
- this property's associated Configuration
, or null
@Nullable public String getErrorMessage()
null
if either the property is valid or it is not known if the property is
valid or not. Depending on the context of where this property instance is will dictate the semantics of a
null
error message (see AbstractResourceConfigurationUpdate
).
public void setErrorMessage(@Nullable String errorMessage)
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public Property deepCopy(boolean keepId)
deepCopy
in interface DeepCopyable<Property>
public String toString()
toString
in class Object
protected void appendToStringInternals(StringBuilder str)
str
- the builder to append strings topublic int compareTo(Property other)
compareTo
in interface Comparable<Property>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |