public static final class Filter.Util extends Object
import static de.espirit.common.util.Filter.Util.and; import static de.espirit.common.util.Filter.Util.doFilter; import static de.espirit.common.util.Filter.Util.not; import static de.espirit.common.util.Filter.Util.or; ... ListallResults = ...; Filter<Integer> biggerThanZero = ...; Filter<Integer> isMultipleOf_13 = ...; Filter<Integer> isOdd = ...; Filter<Integer> combinedFilter = and(de.espirit.common.util.Filter<T>...)
(biggerThanZero,not(de.espirit.common.util.Filter<T>)
(or(de.espirit.common.util.Filter<T>...)
(isMultipleOf_13, isOdd))); ListfilteredResult = doFilter(java.util.Collection<T>, de.espirit.common.util.Filter<T>, C)
(allResults, combinedFilter, new ArrayList<Integer>());
Modifier and Type | Method and Description |
---|---|
static <T> Filter<T> |
acceptAll() |
static <T> Filter<T> |
acceptNothing() |
static <T> Filter<T> |
and(Collection<Filter<T>> f) |
static <T> Filter<T> |
and(Filter<T>... f) |
static <T,C extends Collection<T>> |
doFilter(Collection<T> source,
Filter<T> filter,
C target)
Copies all matching entries of collection source to collection target.
|
static <T> Filter<T> |
equal(T value) |
static <T> Filter<T> |
implies(Filter<T> condition,
Filter<T> implication)
a implies b is equivalent to not(a) or b.
|
static <T> Filter<T> |
not(Filter<T> f) |
static <T> Filter<T> |
notNull() |
static <T> Filter<T> |
or(Collection<Filter<T>> f) |
static <T> Filter<T> |
or(Filter<T>... f) |
@NotNull public static <T> Filter<T> and(@NotNull Collection<Filter<T>> f)
@NotNull public static <T> Filter<T> or(@NotNull Collection<Filter<T>> f)
@NotNull public static <T> Filter<T> implies(@NotNull Filter<T> condition, @NotNull Filter<T> implication)
@NotNull public static <T,C extends Collection<T>> C doFilter(@NotNull Collection<T> source, @NotNull Filter<T> filter, @NotNull C target)
source
- source collectionfilter
- filter - only matching entries will be copiedtarget
- target collectionCopyright © 2014 e-Spirit AG. All Rights Reserved. Build 5.0_BETA.500