Package io.activej.async.function
Class AsyncBiPredicates
java.lang.Object
io.activej.async.function.AsyncBiPredicates
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,U> AsyncBiPredicate<T, U> and()Returns anAsyncBiPredicatethat always returns promise oftruestatic <T,U> AsyncBiPredicate<T, U> and(AsyncBiPredicate<? super T, ? super U> predicate1) Returns a given asynchronous predicatestatic <T,U> AsyncBiPredicate<T, U> and(AsyncBiPredicate<? super T, ? super U>... predicates) Returns a composedAsyncBiPredicatethat represents a logical AND of all predicates in a given arraystatic <T,U> AsyncBiPredicate<T, U> and(AsyncBiPredicate<? super T, ? super U> predicate1, AsyncBiPredicate<? super T, ? super U> predicate2) An optimization forand(AsyncBiPredicate[])static <T,U> AsyncBiPredicate<T, U> and(Collection<AsyncBiPredicate<? super T, ? super U>> predicates) Returns a composedAsyncBiPredicatethat represents a logical AND of all predicates in a given collectionstatic <T,U> AsyncBiPredicate<T, U> buffer(int maxParallelCalls, int maxBufferedCalls, AsyncBiPredicate<T, U> predicate) static <T,U> AsyncBiPredicate<T, U> buffer(AsyncBiPredicate<T, U> actual) static <T,U> AsyncBiPredicate<T, U> ofExecutor(AsyncExecutor executor, AsyncBiPredicate<T, U> predicate) static <T,U> AsyncBiPredicate<T, U> or()Returns anAsyncBiPredicatethat always returns promise offalsestatic <T,U> AsyncBiPredicate<T, U> or(AsyncBiPredicate<? super T, ? super U> predicate1) Returns a given asynchronous predicatestatic <T,U> AsyncBiPredicate<T, U> or(AsyncBiPredicate<? super T, ? super U>... predicates) Returns a composedAsyncBiPredicatethat represents a logical OR of all predicates in a given arraystatic <T,U> AsyncBiPredicate<T, U> or(AsyncBiPredicate<? super T, ? super U> predicate1, AsyncBiPredicate<? super T, ? super U> predicate2) An optimization foror(AsyncBiPredicate[])static <T,U> AsyncBiPredicate<T, U> or(Collection<AsyncBiPredicate<? super T, ? super U>> predicates) Returns a composedAsyncBiPredicatethat represents a logical OR of all predicates in a given collection
-
Constructor Details
-
AsyncBiPredicates
public AsyncBiPredicates()
-
-
Method Details
-
buffer
@Contract(pure=true) public static <T,U> AsyncBiPredicate<T,U> buffer(AsyncBiPredicate<T, U> actual) -
buffer
@Contract(pure=true) public static <T,U> AsyncBiPredicate<T,U> buffer(int maxParallelCalls, int maxBufferedCalls, AsyncBiPredicate<T, U> predicate) -
ofExecutor
@Contract(pure=true) public static <T,U> AsyncBiPredicate<T,U> ofExecutor(AsyncExecutor executor, AsyncBiPredicate<T, U> predicate) -
and
public static <T,U> AsyncBiPredicate<T,U> and(Collection<AsyncBiPredicate<? super T, ? super U>> predicates) Returns a composedAsyncBiPredicatethat 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 ofAsyncBiPredicates that will be logically ANDed- Returns:
- a composed
AsyncBiPredicatethat represents a logical AND of asynchronous predicates in a given collection
-
and
Returns anAsyncBiPredicatethat always returns promise oftrue- See Also:
-
and
Returns a given asynchronous predicateA shortcut for
and(AsyncBiPredicate[])- See Also:
-
and
public static <T,U> AsyncBiPredicate<T,U> and(AsyncBiPredicate<? super T, ? super U> predicate1, AsyncBiPredicate<? super T, ? super U> predicate2) An optimization forand(AsyncBiPredicate[])- See Also:
-
and
@SafeVarargs public static <T,U> AsyncBiPredicate<T,U> and(AsyncBiPredicate<? super T, ? super U>... predicates) Returns a composedAsyncBiPredicatethat represents a logical AND of all predicates in a given array- See Also:
-
or
public static <T,U> AsyncBiPredicate<T,U> or(Collection<AsyncBiPredicate<? super T, ? super U>> predicates) Returns a composedAsyncBiPredicatethat 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 ofAsyncBiPredicates that will be logically ORed- Returns:
- a composed
AsyncBiPredicatethat represents a logical OR of asynchronous predicates in a given collection
-
or
Returns anAsyncBiPredicatethat always returns promise offalse- See Also:
-
or
Returns a given asynchronous predicateA shortcut for
or(AsyncBiPredicate[])- See Also:
-
or
public static <T,U> AsyncBiPredicate<T,U> or(AsyncBiPredicate<? super T, ? super U> predicate1, AsyncBiPredicate<? super T, ? super U> predicate2) An optimization foror(AsyncBiPredicate[])- See Also:
-
or
@SafeVarargs public static <T,U> AsyncBiPredicate<T,U> or(AsyncBiPredicate<? super T, ? super U>... predicates) Returns a composedAsyncBiPredicatethat represents a logical OR of all predicates in a given array- See Also:
-