|
||||||||||
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 org.rhq.core.domain.configuration.PropertyMap
public class PropertyMap
Holds a map of child properties
. This can hold any number of properties, including additional lists
and maps of properties (which means you can have N-levels of hierarchical data).
This map will store the properties keyed on property name
.
Caution must be used when accessing this object. This class is not thread safe and, for entity persistence, the
child properties must have their Property.getParentMap()
field set. This is done for you when using the
put(Property)
method.
Field Summary |
---|
Fields inherited from class org.rhq.core.domain.configuration.Property |
---|
QUERY_DELETE_BY_PROPERTY_IDS |
Constructor Summary | |
---|---|
|
PropertyMap()
Creates a new unnamed and empty PropertyMap object. |
protected |
PropertyMap(PropertyMap original,
boolean keepId)
|
|
PropertyMap(String name)
Creates a new, empty PropertyMap object that is associated with the given name. |
|
PropertyMap(String name,
Property... startingProperties)
Creates a new PropertyMap object that is associated with the given name and has the given properties as
its initial set of child properties. |
Method Summary | |
---|---|
void |
afterUnmarshal(Object u,
Object parent)
This listener runs after jaxb unmarshalling and reconnects children properties to their parent maps (as we don't send them avoiding cyclic references). |
protected void |
appendToStringInternals(StringBuilder str)
Subclasses can override this to add things it wants to see in the toString. |
PropertyMap |
deepCopy(boolean keepId)
|
boolean |
equals(Object obj)
NOTE: An PropertyMap containing a null map is considered equal to a PropertyMap containing an empty map. |
Property |
get(String name)
Looks for a property with the given name in the map and returns it. |
PropertyList |
getList(String name)
Looks for a child list property with the given name in the map and returns it. |
Map<String,Property> |
getMap()
Returns the contents of this PropertyMap as a map. |
PropertyMap |
getMap(String name)
Looks for a child map property with the given name in the map and returns it. |
PropertySimple |
getSimple(String name)
Looks for a child simple property with the given name in the map and returns it. |
String |
getSimpleValue(String name,
String defaultValue)
|
int |
hashCode()
|
void |
put(Property property)
Put a child property into this map keyed on the given property's name. |
void |
setMap(Map<String,Property> map)
Sets the map of child properties directly to the given map reference. |
Methods inherited from class org.rhq.core.domain.configuration.Property |
---|
compareTo, getConfiguration, getErrorMessage, getId, getName, getParentList, getParentMap, setConfiguration, setErrorMessage, setId, setName, setParentList, setParentMap, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PropertyMap()
PropertyMap
object.
protected PropertyMap(PropertyMap original, boolean keepId)
public PropertyMap(@NotNull String name)
PropertyMap
object that is associated with the given name.
name
- the name of the map itselfpublic PropertyMap(@NotNull String name, Property... startingProperties)
PropertyMap
object that is associated with the given name and has the given properties as
its initial set of child properties. All properties found in startingProperties
will have their
parent map
set to this newly constructed map.
name
- the name of the map itselfstartingProperties
- a set of properties to be immediately added to this mapMethod Detail |
---|
@NotNull public Map<String,Property> getMap()
Warning: Caution should be used when accessing the returned map. Please see
the javadoc for this class
for more information.
getMap
in interface AbstractPropertyMap
public void setMap(Map<String,Property> map)
map
reference. This means the actual
map
object is stored internally in this object. Changes made to map
will be reflected back
into this object.
Warning: Caution should be used when setting this object's internal map. Please see
the javadoc for this class
for more information.
map
- the new map used internally by this objectpublic void put(@NotNull Property property)
parent map
for the child property to make persistence work.
put
in interface AbstractPropertyMap
property
- the property to add to this map.public Property get(String name)
null
is returned if it is not
found.
get
in interface AbstractPropertyMap
name
- the name of the property to return
null
if it does not exist as a child to this mappublic PropertySimple getSimple(String name)
null
is returned if
it is not found.
getSimple
in interface AbstractPropertyMap
name
- the name of the child simple property to return
null
if it does not exist as a child to this map
ClassCastException
- if the named property is not of type PropertySimple
public String getSimpleValue(String name, String defaultValue)
public PropertyList getList(String name)
null
is returned if
it is not found.
getList
in interface AbstractPropertyMap
name
- the name of the child list property to return
null
if it does not exist as a child to this map
ClassCastException
- if the named property is not of type PropertyList
public PropertyMap getMap(String name)
null
is returned if it
is not found.
getMap
in interface AbstractPropertyMap
name
- the name of the child map property to return
null
if it does not exist as a child to this map
ClassCastException
- if the named property is not of type PropertyMap
public boolean equals(Object obj)
equals
in class Property
public int hashCode()
hashCode
in class Property
public PropertyMap deepCopy(boolean keepId)
deepCopy
in interface DeepCopyable<Property>
deepCopy
in class Property
protected void appendToStringInternals(StringBuilder str)
Property
appendToStringInternals
in class Property
str
- the builder to append strings topublic void afterUnmarshal(Object u, Object parent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |