org.springframework.util
Class CollectionUtils

java.lang.Object
  extended byorg.springframework.util.CollectionUtils

public abstract class CollectionUtils
extends Object

Miscellaneous collection utility methods. Mainly for internal use within the framework.

Since:
1.1.3
Author:
Juergen Hoeller

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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionUtils

public CollectionUtils()
Method Detail

findValueOfType

public static Object findValueOfType(Collection coll,
                                     Class type)
                              throws IllegalArgumentException
Find a value of the given type in the given collection.

Parameters:
coll - the collection to search
type - the type to look for
Returns:
a value of the given type found, or null if none
Throws:
IllegalArgumentException - if more than one value of the given type found

findValueOfType

public static Object findValueOfType(Collection coll,
                                     Class[] types)
                              throws IllegalArgumentException
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.

Parameters:
coll - the collection to search
types - the types to look for, in prioritized order
Returns:
a of one of the given types found, or null if none
Throws:
IllegalArgumentException - if more than one value of the given type found


Copyright (C) 2003-2004 The Spring Framework Project.