A
- The argument type@FunctionalInterface public interface Predicate<A> extends Fn1<A,Boolean>
Fn1
that returns a Boolean
.Modifier and Type | Method and Description |
---|---|
default Predicate<A> |
and(Predicate<? super A> other)
Left-to-right short-circuiting logical conjunction.
|
default <Y,Z> BiPredicate<Y,Z> |
compose(Fn2<? super Y,? super Z,? extends A> before)
Right-to-left composition between different arity functions.
|
default <Z> Predicate<Z> |
contraMap(Fn1<? super Z,? extends A> fn)
Contravariantly map
A <- B . |
default <Z> Predicate<Z> |
diMapL(Fn1<? super Z,? extends A> fn)
Contravariantly map over the argument to this function, producing a function that takes the new argument type,
and produces the same result.
|
default <C> Predicate<A> |
discardR(Applicative<C,Fn1<A,?>> appB)
Sequence both this
Applicative and appB , discarding appB's result and
returning this Applicative . |
static <A> Predicate<A> |
fromPredicate(Predicate<A> predicate)
|
default Predicate<A> |
negate()
Logical negation.
|
default Predicate<A> |
or(Predicate<? super A> other)
Left-to-right short-circuiting logical disjunction.
|
static <A> Predicate<A> |
predicate(Fn1<? super A,? extends Boolean> predicate)
Static factory method to create a predicate from an
Fn1 . |
default Predicate<A> |
toPredicate()
|
default <Z> BiPredicate<Z,A> |
widen()
Widen this function's argument list by prepending an ignored argument of any type to the front.
|
default <Z> Predicate<Z> diMapL(Fn1<? super Z,? extends A> fn)
diMapL
in interface Cartesian<A,Boolean,Fn1<?,?>>
diMapL
in interface Cocartesian<A,Boolean,Fn1<?,?>>
diMapL
in interface Fn1<A,Boolean>
diMapL
in interface Profunctor<A,Boolean,Fn1<?,?>>
Z
- the new argument typefn
- the contravariant argument mapping functionFn1
<Z, B>default <Z> Predicate<Z> contraMap(Fn1<? super Z,? extends A> fn)
A <- B
.contraMap
in interface Cartesian<A,Boolean,Fn1<?,?>>
contraMap
in interface Cocartesian<A,Boolean,Fn1<?,?>>
contraMap
in interface Contravariant<A,Profunctor<?,Boolean,Fn1<?,?>>>
contraMap
in interface Fn1<A,Boolean>
contraMap
in interface Profunctor<A,Boolean,Fn1<?,?>>
Z
- the new parameter typefn
- the mapping functiondefault <Z> BiPredicate<Z,A> widen()
default <C> Predicate<A> discardR(Applicative<C,Fn1<A,?>> appB)
Applicative
and appB
, discarding appB's
result and
returning this Applicative
. This is generally useful for sequentially performing side-effects.discardR
in interface Applicative<Boolean,Fn1<A,?>>
discardR
in interface Fn1<A,Boolean>
discardR
in interface Monad<Boolean,Fn1<A,?>>
discardR
in interface MonadReader<A,Boolean,Fn1<A,?>>
discardR
in interface MonadRec<Boolean,Fn1<A,?>>
discardR
in interface MonadWriter<A,Boolean,Fn1<A,?>>
C
- the type of appB's parameterappB
- the other Applicativedefault <Y,Z> BiPredicate<Y,Z> compose(Fn2<? super Y,? super Z,? extends A> before)
default Predicate<A> and(Predicate<? super A> other)
other
- the predicate to test if this one succeedsdefault Predicate<A> or(Predicate<? super A> other)
other
- the predicate to test if this one failsstatic <A> Predicate<A> predicate(Fn1<? super A,? extends Boolean> predicate)
Fn1
.A
- the input typepredicate
- the Fn1