3.2.4: 2013-12-06

net.sf.basedb.util
Class ListUtil

java.lang.Object
  extended by 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) $

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

Constructor Detail

ListUtil

public ListUtil()
Method Detail

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 collection
check - The collection to check
notFound - The value to return if there are no common elements (including the case were one collection is null or empty)

3.2.4: 2013-12-06