Package io.activej.async.function
Interface AsyncPredicate<T>
- All Superinterfaces:
AsyncPredicateEx<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> AsyncPredicate<T>Returns anAsyncPredicatethat always returns promise offalsestatic <T> AsyncPredicate<T>Returns anAsyncPredicatethat always returns promise oftruedefault AsyncPredicate<T>and(AsyncPredicate<? super T> other) Returns a composedAsyncPredicatethat represents a logical AND of this asynchronous predicate and the otherdefault AsyncPredicate<T>negate()NegatesthisAsyncPredicatestatic <T> AsyncPredicate<T>not(AsyncPredicate<? super T> predicate) Negates a givenAsyncPredicatestatic <T> AsyncPredicate<T>of(io.activej.common.function.PredicateEx<T> predicate) Wraps aPredicateExinterface.default AsyncPredicate<T>or(AsyncPredicate<? super T> other) Returns a composedAsyncPredicatethat represents a logical OR of this asynchronous predicate and the otherstatic <T> AsyncPredicate<T>sanitize(AsyncPredicateEx<T> predicate)
-
Method Details
-
test
- Specified by:
testin interfaceAsyncPredicateEx<T>
-
of
Wraps aPredicateExinterface.- Parameters:
predicate- aPredicateEx- Returns:
AsyncPredicatethat works on top ofPredicateExinterface
-
sanitize
-
alwaysTrue
Returns anAsyncPredicatethat always returns promise oftrue -
alwaysFalse
Returns anAsyncPredicatethat always returns promise offalse -
not
Negates a givenAsyncPredicate- Parameters:
predicate- an originalAsyncPredicate- Returns:
- an
AsyncPredicatethat represents a logical negation of original predicate
-
negate
NegatesthisAsyncPredicate- Returns:
- an
AsyncPredicatethat represents a logical negation ofthispredicate
-
and
Returns a composedAsyncPredicatethat represents a logical AND of this asynchronous predicate and the otherUnlike Java's
Predicate.and(Predicate)this method does not provide short-circuit. If eitherthisorotherpredicate returns an exceptionally completed promise, the combined asynchronous predicate also returns an exceptionally completed promise- Parameters:
other- otherAsyncPredicatethat will be logically ANDed withthispredicate- Returns:
- a composed
AsyncPredicatethat represents a logical AND of this asynchronous predicate and the other
-
or
Returns a composedAsyncPredicatethat represents a logical OR of this asynchronous predicate and the otherUnlike Java's
Predicate.or(Predicate)this method does not provide short-circuit. If eitherthisorotherpredicate returns an exceptionally completed promise, the combined asynchronous predicate also returns an exceptionally completed promise- Parameters:
other- otherAsyncPredicatethat will be logically ORed withthispredicate- Returns:
- a composed
AsyncPredicatethat represents a logical OR of this asynchronous predicate and the other
-