Class CollectionUtils
java.lang.Object
org.springframework.webflow.core.collection.CollectionUtils
A utility class for working with attribute and parameter collections used by Spring Web FLow.
- Author:
- Keith Donald, Erwin Vervaet
-
Field Summary
Modifier and TypeFieldDescriptionstatic final AttributeMap<Object>
The shared, singleton empty attribute map instance.static final Iterator
The shared, singleton empty iterator instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> boolean
addAllNoDuplicates
(List<T> target, T... objects) Add all given objects to given target list.static <E> Iterator<E>
static <V> AttributeMap<V>
singleEntryMap
(String attributeName, V attributeValue) Factory method that returns a unmodifiable attribute map with a single entry.static <E> Iterator<E>
toIterator
(Enumeration<E> enumeration) Factory method that adapts an enumeration to an iterator.
-
Field Details
-
EMPTY_ITERATOR
The shared, singleton empty iterator instance. -
EMPTY_ATTRIBUTE_MAP
The shared, singleton empty attribute map instance.
-
-
Method Details
-
emptyIterator
-
toIterator
Factory method that adapts an enumeration to an iterator.- Parameters:
enumeration
- the enumeration- Returns:
- the iterator
-
singleEntryMap
Factory method that returns a unmodifiable attribute map with a single entry.- Parameters:
attributeName
- the attribute nameattributeValue
- the attribute value- Returns:
- the unmodifiable map with a single element
-
addAllNoDuplicates
Add all given objects to given target list. No duplicates will be added. The contains() method of the given target list will be used to determine whether or not an object is already in the list.- Parameters:
target
- the collection to which to objects will be addedobjects
- the objects to add- Returns:
- whether or not the target collection changed
-