A
- the predicate argument type.public final class CompositePredicate<A> extends Object implements Predicate<A>
Predicate
representing the composition of
Functions
,
"chaining" the output of one to the input
of another. For example,
new CompositePredicate(p).of(f)
tests
to
p.test(f.evaluate(obj))
, and
new CompositePredicate(p).of(f).of(g)
tests
to
p.test(f.evaluate(g.evaluate(obj)))
.Constructor and Description |
---|
CompositePredicate(Predicate<? super A> predicate)
Create a new CompositePredicate.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
<P> CompositePredicate<P> |
of(Function<? super P,? extends A> preceding)
Fluently obtain a CompositePredicate that applies our predicate to the result of the preceding function.
|
boolean |
test(A obj)
Evaluate this predicate.
|
String |
toString() |
public CompositePredicate(Predicate<? super A> predicate)
predicate
- Predicate against which the composite functions' output will be testedpublic <P> CompositePredicate<P> of(Function<? super P,? extends A> preceding)
P
- the input function left argument and output predicate argument typespreceding
- FunctionCopyright © 2003–2014 The Apache Software Foundation. All rights reserved.