public class Filter<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MATCH_ALL
Indicates that all rules must be matched to include an object in the filtered collection.
|
static int |
MATCH_ANY
Indicates that any rule may be matched to include an object in the filtered collection.
|
Constructor and Description |
---|
Filter(java.util.function.Predicate<T>... rules) |
Filter(java.util.function.Predicate<T>[] rules,
int type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<T> |
filter(java.util.Collection<T> c)
Filter the given collection into a new collection.
|
T[] |
filter(T[] objects)
Returns a filtered subset of the specified array.
|
java.util.function.Predicate<T>[] |
getRules() |
void |
setRules(java.util.function.Predicate<T>[] rules) |
public static final int MATCH_ANY
public static final int MATCH_ALL
@SafeVarargs public Filter(java.util.function.Predicate<T>... rules)
rules
- one or more rules that are applied by this filterpublic final java.util.Collection<T> filter(java.util.Collection<T> c)
c
- a collection to filterpublic final T[] filter(T[] objects)
objects
- an array to filterpublic final java.util.function.Predicate<T>[] getRules()
public final void setRules(java.util.function.Predicate<T>[] rules)
rules
- The rules to set.