public class AttributeValueSet extends Object
AttributeValueSet (A) to
be "based" on another AttributeValueSet (B), whereby the main
AttributeValueSet (A) inherits all values from the base
AttributeValueSet (B) and can override some of them. Any depth of the base
attribute sets hierarchy is possible.| Modifier and Type | Field and Description |
|---|---|
String |
description
Human-readable description of this attribute value set.
|
String |
label
Human-readable value of this attribute value set.
|
| Constructor and Description |
|---|
AttributeValueSet(String label)
|
AttributeValueSet(String label,
AttributeValueSet base)
Creates a new empty
AttributeValueSet with a null description. |
AttributeValueSet(String label,
String description,
AttributeValueSet base)
Creates a new empty
AttributeValueSet. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttributeValue(String key)
Returns value of the attribute with the provided
key. |
Map<String,Object> |
getAttributeValues()
Returns attribute values defined by this
AttributeValueSet and all other
AttributeValueSets that this set is based on. |
static Map<String,Object> |
getAttributeValues(AttributeValueSet attributeValueSet)
Returns attribute values from the provided
AttributeValueSet or
null if the provided AttributeValueSet is null. |
Object |
setAttributeValue(String key,
Object value)
Sets a
value corresponding to the provided key in this
attribute value set. |
void |
setAttributeValues(Map<String,Object> values)
Copies all
values to this attribute value set. |
String |
toString() |
public String label
public String description
public AttributeValueSet(String label)
label - human-readable label for this attribute value setpublic AttributeValueSet(String label, AttributeValueSet base)
AttributeValueSet with a null description.label - human-readable label for this attribute value setbase - the attribute value set this set should be based on.public AttributeValueSet(String label, String description, AttributeValueSet base)
AttributeValueSet.label - human-readable label for this attribute value setdescription - human-readable description for this attribute value set, can be
nullbase - the attribute value set this set should be based on, can be
null.public Object getAttributeValue(String key)
key. Attribute values
are resolved in the following order:
key set
by {setAttributeValue(String, Object) or setAttributeValues(Map),
the value is returned.null, attribute
value is retrieved from the base set by calling the same method on it. If any of
the base attribute sets in the hierarchy contains a value for the provided key,
that value is returned.null is returned.key - key of the attribute for which value is to be returnednull.public Map<String,Object> getAttributeValues()
AttributeValueSet and all other
AttributeValueSets that this set is based on. The returned map is
independent of this AttributeValueSet, so any modifications to that map
will not be reflected in this AttributeValueSet.public Object setAttributeValue(String key, Object value)
value corresponding to the provided key in this
attribute value set. If the set previously contained some value under the provided
key, that value is returned. Values set using this method override
values found in the base attribute sets of this set.key - attribute keyvalue - attribute valuenullpublic void setAttributeValues(Map<String,Object> values)
values to this attribute value set. If this attribute value
set already contains mappings for some of the provided key, the mappings will be
overwritten. Values set using this method override values found in the base
attribute sets of this set.values - values to be set on this attribute value set.public static Map<String,Object> getAttributeValues(AttributeValueSet attributeValueSet)
AttributeValueSet or
null if the provided AttributeValueSet is null.