Package io.activej.async.function
Class AsyncPredicates
java.lang.Object
io.activej.async.function.AsyncPredicates
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> AsyncPredicate<T>and()Returns anAsyncPredicatethat always returns promise oftruestatic <T> AsyncPredicate<T>and(AsyncPredicate<? super T> predicate1) Returns a given asynchronous predicatestatic <T> AsyncPredicate<T>and(AsyncPredicate<? super T>... predicates) Returns a composedAsyncPredicatethat represents a logical AND of all predicates in a given arraystatic <T> AsyncPredicate<T>and(AsyncPredicate<? super T> predicate1, AsyncPredicate<? super T> predicate2) An optimization forand(AsyncPredicate[])static <T> AsyncPredicate<T>and(Collection<AsyncPredicate<? super T>> predicates) Returns a composedAsyncPredicatethat represents a logical AND of all predicates in a given collectionstatic <T> AsyncPredicate<T>buffer(int maxParallelCalls, int maxBufferedCalls, AsyncPredicate<T> predicate) static <T> AsyncPredicate<T>buffer(AsyncPredicate<T> actual) static <T> AsyncPredicate<T>ofExecutor(AsyncExecutor executor, AsyncPredicate<T> predicate) static <T> AsyncPredicate<T>or()static <T> AsyncPredicate<T>or(AsyncPredicate<? super T> predicate1) Returns a given asynchronous predicatestatic <T> AsyncPredicate<T>or(AsyncPredicate<? super T>... predicates) Returns a composedAsyncPredicatethat represents a logical OR of all predicates in a given arraystatic <T> AsyncPredicate<T>or(AsyncPredicate<? super T> predicate1, AsyncPredicate<? super T> predicate2) An optimization foror(AsyncPredicate[])static <T> AsyncPredicate<T>or(Collection<AsyncPredicate<? super T>> predicates) Returns a composedAsyncPredicatethat represents a logical OR of all predicates in a given collection
-
Constructor Details
-
AsyncPredicates
public AsyncPredicates()
-
-
Method Details
-
buffer
-
buffer
@Contract(pure=true) public static <T> AsyncPredicate<T> buffer(int maxParallelCalls, int maxBufferedCalls, AsyncPredicate<T> predicate) -
ofExecutor
@Contract(pure=true) public static <T> AsyncPredicate<T> ofExecutor(AsyncExecutor executor, AsyncPredicate<T> predicate) -
and
Returns a composedAsyncPredicatethat represents a logical AND of all predicates in a given collectionUnlike Java's
Predicate.and(Predicate)this method does not provide short-circuit. If either predicate returns an exceptionally completed promise, the combined asynchronous predicate also returns an exceptionally completed promise- Parameters:
predicates- a collection ofAsyncPredicates that will be logically ANDed- Returns:
- a composed
AsyncPredicatethat represents a logical AND of asynchronous predicates in a given collection
-
and
Returns anAsyncPredicatethat always returns promise oftrue- See Also:
-
and
Returns a given asynchronous predicateA shortcut for
and(AsyncPredicate[])- See Also:
-
and
public static <T> AsyncPredicate<T> and(AsyncPredicate<? super T> predicate1, AsyncPredicate<? super T> predicate2) An optimization forand(AsyncPredicate[])- See Also:
-
and
Returns a composedAsyncPredicatethat represents a logical AND of all predicates in a given array- See Also:
-
or
Returns a composedAsyncPredicatethat represents a logical OR of all predicates in a given collectionUnlike Java's
Predicate.or(Predicate)this method does not provide short-circuit. If either predicate returns an exceptionally completed promise, the combined asynchronous predicate also returns an exceptionally completed promise- Parameters:
predicates- a collection ofAsyncPredicates that will be logically ORed- Returns:
- a composed
AsyncPredicatethat represents a logical OR of asynchronous predicates in a given collection
-
or
- Returns:
- an
AsyncPredicatethat always returns promise offalse - See Also:
-
or
Returns a given asynchronous predicateA shortcut for
or(AsyncPredicate[])- See Also:
-
or
public static <T> AsyncPredicate<T> or(AsyncPredicate<? super T> predicate1, AsyncPredicate<? super T> predicate2) An optimization foror(AsyncPredicate[])- See Also:
-
or
Returns a composedAsyncPredicatethat represents a logical OR of all predicates in a given array- See Also:
-