public class FilterUtil extends Object
Constructor and Description |
---|
FilterUtil() |
Modifier and Type | Method and 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 the
Filter.evaluate(Object) method. |
public static <T> List<T> filter(Collection<? extends T> objects, Filter<? super T> filter)
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.objects
- The collection of objectsfilter
- The filter