|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.util.CollectionUtils
public abstract class CollectionUtils
Miscellaneous collection utility methods. Mainly for internal use within the framework.
Constructor Summary | |
---|---|
CollectionUtils()
|
Method Summary | |
---|---|
static Object |
findValueOfType(Collection coll,
Class type)
Find a value of the given type in the given collection. |
static Object |
findValueOfType(Collection coll,
Class[] types)
Find a value of one of the given types in the given collection: searching the collection for a value of the first type, then searching for a value of the second type, etc. |
static boolean |
hasUniqueObject(Collection coll)
Determine whether the given collection only contains a single unique object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectionUtils()
Method Detail |
---|
public static boolean hasUniqueObject(Collection coll)
coll
- the collection to check
true
if the collection contains a
single reference or multiple references to the same
instance, false
elsepublic static Object findValueOfType(Collection coll, Class type) throws IllegalArgumentException
coll
- the collection to searchtype
- the type to look for
IllegalArgumentException
- if more than one value
of the given type foundpublic static Object findValueOfType(Collection coll, Class[] types) throws IllegalArgumentException
coll
- the collection to searchtypes
- the types to look for, in prioritized order
IllegalArgumentException
- if more than one value
of the given type found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |