E - the type of object that is filtered.public interface Filter<E>
A filter for accepting or rejecting objects.
Instances of classFilter are required to be immutable.| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(E e)
Returns
true if the specified object is
accepted and returns false if the specified object
is rejected. |
static <E> Filter<E> |
acceptAllFilter()
Returns a filter that accepts all non-null objects.
|
static <E> Filter<E> |
excludeFilter(java.util.Collection<E> exclude)
Returns a filter that accepts all non-null objects that are not
contained in the specified collection.
|
static <E> Filter<E> |
includeFilter(java.util.Collection<E> include)
Returns a filter that accepts all non-null objects that are
contained in the specified collection.
|
static <E> Filter<E> acceptAllFilter()
E - the type of object that is filteredstatic <E> Filter<E> includeFilter(java.util.Collection<E> include)
E - the type of object that is filteredinclude - the collection of objects that will be accepted by
the filterjava.lang.NullPointerException - if include == nullstatic <E> Filter<E> excludeFilter(java.util.Collection<E> exclude)
E - the type of object that is filteredexclude - the collection of objects that will be rejected
by the filterjava.lang.NullPointerException - if exclude == nullboolean accept(E e)
true if the specified object is
accepted and returns false if the specified object
is rejected.e - the object to be filteredtrue if the specified object is
acceptedjava.lang.NullPointerException - if e==null