Package net.sf.basedb.util.filter
Class FilterUtil
java.lang.Object
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 (ti, 21 okt 2008) $
-
Constructor Summary
Constructors Constructor Description FilterUtil()
-
Method Summary
Modifier and Type Method Description 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 theFilter.evaluate(Object)
method.
-
Constructor Details
-
FilterUtil
public FilterUtil()
-
-
Method Details
-
filter
Filter a collection and return a new collection with the objects that passes theFilter.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 objectsfilter
- The filter- Returns:
- A new collection, or null if the original collection is null
- Since:
- 2.9
-