Package de.xima.fc.utils
Class PredicateUtils
- java.lang.Object
-
- de.xima.fc.utils.PredicateUtils
-
-
Constructor Summary
Constructors Constructor Description PredicateUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A,B>
Predicate<A>compose(Predicate<B> predicate, Function<A,? extends B> function)
Returns the composition of a function and a predicate.
-
-
-
Method Detail
-
compose
public static <A,B> Predicate<A> compose(Predicate<B> predicate, Function<A,? extends B> function)
Returns the composition of a function and a predicate. For everyx
, the generated predicate returnspredicate(function(x))
.- Type Parameters:
A
- Type of the items that can be tested by the composed predicate.B
- Type of the items that can be tested by the predicate to compose.- Parameters:
predicate
- Predicate to compose.function
- Mapping function.- Returns:
- the composition of the provided function and predicate
-
-