2.17.2: 2011-06-17

net.sf.basedb.util.filter
Class FilterUtil

java.lang.Object
  extended by net.sf.basedb.util.filter.FilterUtil

public class FilterUtil
extends Object

Utility class for working with and using filters.

Version:
2.9
Author:
Nicklas
Last modified
$Date: 2008-10-21 09:20:40 +0200 (Tue, 21 Oct 2008) $

Constructor Summary
FilterUtil()
           
 
Method Summary
static
<T> List<T>
filter(Collection<? extends T> objects, Filter<? super T> filter)
          Filter a collection and return a new collection with the objects that passes the Filter.evaluate(Object) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterUtil

public FilterUtil()
Method Detail

filter

public static <T> List<T> filter(Collection<? extends T> objects,
                                 Filter<? super T> filter)
Filter a collection and return a new collection with the objects that passes the Filter.evaluate(Object) method. If the original collection is null, null is returned. If the original collection is empty, or if no objects passes the filter an empty list is returned. If the filter is null a list with all objects of the original collection is returned. The original collection is never modifed.

Parameters:
objects - The collection of objects
filter - The filter
Returns:
A new collection, or null if the original collection is null
Since:
2.9

2.17.2: 2011-06-17