|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.webflow.core.collection.LocalAttributeMap
public class LocalAttributeMap
A generic, mutable attribute map with string keys.
| Constructor Summary | |
|---|---|
LocalAttributeMap()
Creates a new attribute map, initially empty. |
|
LocalAttributeMap(int size,
int loadFactor)
Creates a new attribute map, initially empty. |
|
LocalAttributeMap(Map map)
Creates a new attribute map wrapping the specified map. |
|
LocalAttributeMap(String attributeName,
Object attributeValue)
Creates a new attribute map with a single entry. |
|
| Method Summary | |
|---|---|
Map |
asMap()
Returns this object's contents as a Map. |
MutableAttributeMap |
clear()
Remove all attributes in this map. |
boolean |
contains(String attributeName)
Does the attribute with the provided name exist in this map? |
boolean |
contains(String attributeName,
Class requiredType)
Does the attribute with the provided name exist in this map and is its value of the specified required type? |
boolean |
equals(Object o)
|
Object |
extract(String attributeName)
Extract an attribute from this map, getting it and removing it in a single operation. |
Object |
get(String attributeName)
Get an attribute value out of this map, returning null if not found. |
Object |
get(String attributeName,
Class requiredType)
Get an attribute value, asserting the value is of the required type. |
Object |
get(String attributeName,
Class requiredType,
Object defaultValue)
Get an attribute value, asserting the value is of the required type and returning the default value if not found. |
Object |
get(String attributeName,
Object defaultValue)
Get an attribute value, returning the default value if no value is found. |
Object[] |
getArray(String attributeName,
Class requiredType)
Returns an array attribute value in the map and makes sure it is of the required type. |
Boolean |
getBoolean(String attributeName)
Returns a boolean attribute value in the map, returning null if no value was found. |
Boolean |
getBoolean(String attributeName,
Boolean defaultValue)
Returns a boolean attribute value in the map, returning the default value if no value was found. |
Collection |
getCollection(String attributeName)
Returns a collection attribute value in the map. |
Collection |
getCollection(String attributeName,
Class requiredType)
Returns a collection attribute value in the map and make sure it is of the required type. |
Integer |
getInteger(String attributeName)
Returns an integer attribute value in the map, returning null if no value was found. |
Integer |
getInteger(String attributeName,
Integer defaultValue)
Returns an integer attribute value in the map, returning the default value if no value was found. |
Long |
getLong(String attributeName)
Returns a long attribute value in the map, returning null if no value was found. |
Long |
getLong(String attributeName,
Long defaultValue)
Returns a long attribute value in the map, returning the default value if no value was found. |
Number |
getNumber(String attributeName,
Class requiredType)
Returns a number attribute value in the map that is of the specified type, returning null if no
value was found. |
Number |
getNumber(String attributeName,
Class requiredType,
Number defaultValue)
Returns a number attribute value in the map of the specified type, returning the default value if no value was found. |
Object |
getRequired(String attributeName)
Get the value of a required attribute, throwing an exception of no attribute is found. |
Object |
getRequired(String attributeName,
Class requiredType)
Get the value of a required attribute and make sure it is of the required type. |
Object[] |
getRequiredArray(String attributeName,
Class requiredType)
Returns an array attribute value in the map, throwing an exception if the attribute is not present or not an array of the required type. |
Boolean |
getRequiredBoolean(String attributeName)
Returns a boolean attribute value in the map, throwing an exception if the attribute is not present and of the correct type. |
Collection |
getRequiredCollection(String attributeName)
Returns a collection attribute value in the map, throwing an exception if the attribute is not present or not a collection. |
Collection |
getRequiredCollection(String attributeName,
Class requiredType)
Returns a collection attribute value in the map, throwing an exception if the attribute is not present or not a collection of the required type. |
Integer |
getRequiredInteger(String attributeName)
Returns an integer attribute value in the map, throwing an exception if the attribute is not present and of the correct type. |
Long |
getRequiredLong(String attributeName)
Returns a long attribute value in the map, throwing an exception if the attribute is not present and of the correct type. |
Number |
getRequiredNumber(String attributeName,
Class requiredType)
Returns a number attribute value in the map, throwing an exception if the attribute is not present and of the correct type. |
String |
getRequiredString(String attributeName)
Returns a string attribute value in the map, throwing an exception if the attribute is not present and of the correct type. |
String |
getString(String attributeName)
Returns a string attribute value in the map, returning null if no value was found. |
String |
getString(String attributeName,
String defaultValue)
Returns a string attribute value in the map, returning the default value if no value was found. |
int |
hashCode()
|
boolean |
isEmpty()
Is this attribute map empty with a size of 0? |
Object |
put(String attributeName,
Object attributeValue)
Put the attribute into this map. |
MutableAttributeMap |
putAll(AttributeMap attributes)
Put all the attributes into this map. |
Object |
remove(String attributeName)
Remove an attribute from this map. |
MutableAttributeMap |
removeAll(MutableAttributeMap attributes)
Remove all attributes in the map provided from this map. |
MutableAttributeMap |
replaceWith(AttributeMap attributes)
Replace the contents of this attribute map with the contents of the provided collection. |
int |
size()
Returns the size of this map. |
String |
toString()
|
AttributeMap |
union(AttributeMap attributes)
Returns a new attribute map containing the union of this map with the provided map. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LocalAttributeMap()
public LocalAttributeMap(int size,
int loadFactor)
size - the initial sizeloadFactor - the load factor
public LocalAttributeMap(String attributeName,
Object attributeValue)
public LocalAttributeMap(Map map)
| Method Detail |
|---|
public Map asMap()
MapAdaptableMap. The returned map may or may not be modifiable depending on this
implementation.
Warning: this operation may be called frequently; if so care should be taken so that the map contents (if calculated) be cached as appropriate.
asMap in interface MapAdaptablepublic int size()
AttributeMap
size in interface AttributeMappublic Object get(String attributeName)
AttributeMapnull if not found.
get in interface AttributeMapattributeName - the attribute name
public boolean isEmpty()
AttributeMap
isEmpty in interface AttributeMappublic boolean contains(String attributeName)
AttributeMap
contains in interface AttributeMapattributeName - the attribute name
public boolean contains(String attributeName,
Class requiredType)
throws IllegalArgumentException
AttributeMap
contains in interface AttributeMapattributeName - the attribute namerequiredType - the required class of the attribute value
IllegalArgumentException - when the value is not of the required type
public Object get(String attributeName,
Object defaultValue)
AttributeMap
get in interface AttributeMapattributeName - the name of the attributedefaultValue - the default value
public Object get(String attributeName,
Class requiredType)
throws IllegalArgumentException
AttributeMap
get in interface AttributeMapattributeName - the name of the attributerequiredType - the required type of the attribute value
IllegalArgumentException - when the value is not of the required type
public Object get(String attributeName,
Class requiredType,
Object defaultValue)
throws IllegalStateException
AttributeMap
get in interface AttributeMapattributeName - the name of the attributerequiredType - the value required typedefaultValue - the default value
IllegalStateException
public Object getRequired(String attributeName)
throws IllegalArgumentException
AttributeMap
getRequired in interface AttributeMapattributeName - the name of the attribute
IllegalArgumentException - when the attribute is not found
public Object getRequired(String attributeName,
Class requiredType)
throws IllegalArgumentException
AttributeMap
getRequired in interface AttributeMapattributeName - name of the attribute to getrequiredType - the required type of the attribute value
IllegalArgumentException - when the attribute is not found or not of the required type
public String getString(String attributeName)
throws IllegalArgumentException
AttributeMapnull if no value was found.
getString in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is present but not a string
public String getString(String attributeName,
String defaultValue)
throws IllegalArgumentException
AttributeMap
getString in interface AttributeMapattributeName - the attribute namedefaultValue - the default
IllegalArgumentException - if the attribute is present but not a string
public String getRequiredString(String attributeName)
throws IllegalArgumentException
AttributeMap
getRequiredString in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is not present or present but not a string
public Collection getCollection(String attributeName)
throws IllegalArgumentException
AttributeMap
getCollection in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is present but not a collection
public Collection getCollection(String attributeName,
Class requiredType)
throws IllegalArgumentException
AttributeMap
getCollection in interface AttributeMapattributeName - the attribute namerequiredType - the required type of the attribute value
IllegalArgumentException - if the attribute is present but not a collection of the required type
public Collection getRequiredCollection(String attributeName)
throws IllegalArgumentException
AttributeMap
getRequiredCollection in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is not present or is present but not a collection
public Collection getRequiredCollection(String attributeName,
Class requiredType)
throws IllegalArgumentException
AttributeMap
getRequiredCollection in interface AttributeMapattributeName - the attribute namerequiredType - the required collection type
IllegalArgumentException - if the attribute is not present or is present but not a collection of the
required type
public Object[] getArray(String attributeName,
Class requiredType)
throws IllegalArgumentException
AttributeMap
getArray in interface AttributeMapattributeName - the attribute namerequiredType - the required type of the attribute value
IllegalArgumentException - if the attribute is present but not an array of the required type
public Object[] getRequiredArray(String attributeName,
Class requiredType)
throws IllegalArgumentException
AttributeMap
getRequiredArray in interface AttributeMapattributeName - the attribute namerequiredType - the required array type
IllegalArgumentException - if the attribute is not present or is present but not a array of the required
type
public Number getNumber(String attributeName,
Class requiredType)
throws IllegalArgumentException
AttributeMapnull if no
value was found.
getNumber in interface AttributeMapattributeName - the attribute namerequiredType - the required number type
IllegalArgumentException - if the attribute is present but not a number of the required type
public Number getNumber(String attributeName,
Class requiredType,
Number defaultValue)
throws IllegalArgumentException
AttributeMap
getNumber in interface AttributeMapattributeName - the attribute namedefaultValue - the default
IllegalArgumentException - if the attribute is present but not a number of the required type
public Number getRequiredNumber(String attributeName,
Class requiredType)
throws IllegalArgumentException
AttributeMap
getRequiredNumber in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is not present or present but not a number of the required type
public Integer getInteger(String attributeName)
throws IllegalArgumentException
AttributeMapnull if no value was found.
getInteger in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is present but not an integer
public Integer getInteger(String attributeName,
Integer defaultValue)
throws IllegalArgumentException
AttributeMap
getInteger in interface AttributeMapattributeName - the attribute namedefaultValue - the default
IllegalArgumentException - if the attribute is present but not an integer
public Integer getRequiredInteger(String attributeName)
throws IllegalArgumentException
AttributeMap
getRequiredInteger in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is not present or present but not an integer
public Long getLong(String attributeName)
throws IllegalArgumentException
AttributeMapnull if no value was found.
getLong in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is present but not a long
public Long getLong(String attributeName,
Long defaultValue)
throws IllegalArgumentException
AttributeMap
getLong in interface AttributeMapattributeName - the attribute namedefaultValue - the default
IllegalArgumentException - if the attribute is present but not a long
public Long getRequiredLong(String attributeName)
throws IllegalArgumentException
AttributeMap
getRequiredLong in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is not present or present but not a long
public Boolean getBoolean(String attributeName)
throws IllegalArgumentException
AttributeMapnull if no value was found.
getBoolean in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is present but not a boolean
public Boolean getBoolean(String attributeName,
Boolean defaultValue)
throws IllegalArgumentException
AttributeMap
getBoolean in interface AttributeMapattributeName - the attribute namedefaultValue - the default
IllegalArgumentException - if the attribute is present but not a boolean
public Boolean getRequiredBoolean(String attributeName)
throws IllegalArgumentException
AttributeMap
getRequiredBoolean in interface AttributeMapattributeName - the attribute name
IllegalArgumentException - if the attribute is not present or present but is not a booleanpublic AttributeMap union(AttributeMap attributes)
AttributeMap
union in interface AttributeMapattributes - the map to combine with this map
public Object put(String attributeName,
Object attributeValue)
MutableAttributeMap
If the attribute value is an AttributeMapBindingListener this map will publish
binding events such as on "bind" and "unbind" if supported.
Note: not all MutableAttributeMap implementations support this.
put in interface MutableAttributeMapattributeName - the attribute nameattributeValue - the attribute value
null of there was no previous valuepublic MutableAttributeMap putAll(AttributeMap attributes)
MutableAttributeMap
putAll in interface MutableAttributeMapattributes - the attributes to put into this map
public MutableAttributeMap removeAll(MutableAttributeMap attributes)
MutableAttributeMap
removeAll in interface MutableAttributeMapattributes - the attributes to remove from this map
public Object remove(String attributeName)
MutableAttributeMap
remove in interface MutableAttributeMapattributeName - the name of the attribute to remove
public Object extract(String attributeName)
MutableAttributeMap
extract in interface MutableAttributeMapattributeName - the attribute name
null of there was no value
public MutableAttributeMap clear()
throws UnsupportedOperationException
MutableAttributeMap
clear in interface MutableAttributeMapUnsupportedOperationException
public MutableAttributeMap replaceWith(AttributeMap attributes)
throws UnsupportedOperationException
MutableAttributeMap
replaceWith in interface MutableAttributeMapattributes - the attribute collection
UnsupportedOperationExceptionpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||