net.sf.basedb.util
Class ListUtil
java.lang.Object
net.sf.basedb.util.ListUtil
public class ListUtil
- extends Object
- Since:
- 3.0
- Author:
- Nicklas
- Last modified
- $Date: 2011-10-27 09:16:20 +0200 (Thu, 27 Oct 2011) $
Method Summary |
static
|
findFirstCommon(Collection<T> master,
Collection<T> check,
T notFound)
Find the first entry in the master collection that is also present in the
check collection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ListUtil
public ListUtil()
findFirstCommon
public static <T> T findFirstCommon(Collection<T> master,
Collection<T> check,
T notFound)
- Find the first entry in the master collection that is also present in the
check collection. If there is no such entry, the notFound value is returned.
- Parameters:
master
- The master collectioncheck
- The collection to checknotFound
- The value to return if there are no common elements
(including the case were one collection is null or empty)