Class CffuFactory

java.lang.Object
io.foldright.cffu.CffuFactory

@ThreadSafe public final class CffuFactory extends Object
This class CffuFactory is equivalent to CompletableFuture, contains the static (factory) methods of CompletableFuture.

The methods that equivalent to the instance methods of CompletableFuture is in Cffu class.

Use builder(Executor) to config and build CffuFactory.

About factory methods conventions of CffuFactory:

Author:
Jerry Lee (oldratlee at gmail dot com), HuHao (995483610 at qq dot com)
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new Cffu that is successful when all the given stages success; If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
    Returns a new Cffu that is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.
    final <T> Cffu<List<T>>
    Returns a new Cffu that is successful with the results in the same order of the given stages arguments when all the given stages success; If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
    final <T> Cffu<List<T>>
    allResultsOf(CompletionStage<? extends T>... cfs)
    Returns a new Cffu with the results in the same order of the given stages arguments, the new Cffu is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.
    final <T> Cffu<List<T>>
    allSuccessResultsOf(T valueIfFailed, CompletionStage<? extends T>... cfs)
    Returns a new Cffu that is successful with the results in the same order of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
    <T1, T2> Cffu<Tuple2<T1,T2>>
    allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
    Returns a new Cffu that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
    Returns a new Cffu that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
    Returns a new Cffu that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
    Returns a new Cffu that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
    <T1, T2> Cffu<Tuple2<T1,T2>>
    allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
    Returns a new Cffu that is successful when the given two stages success.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
    Returns a new Cffu that is successful when the given three stages success.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
    Returns a new Cffu that is successful when the given four stages success.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
    Returns a new Cffu that is successful when the given five stages success.
    <T1, T2> Cffu<Tuple2<T1,T2>>
    allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
    Returns a new Cffu that is completed when the given two stages complete.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
    Returns a new Cffu that is completed when the given three stages complete.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
    Returns a new Cffu that is completed when the given four stages complete.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
    Returns a new Cffu that is completed when the given five stages complete.
    final <T> Cffu<T>
    anyOf(CompletionStage<? extends T>... cfs)
    Returns a new Cffu that is completed when any of the given stages complete, with the same result.
    Otherwise, if it completed exceptionally, the returned Cffu also does so, with a CompletionException holding this exception as its cause.
    If no stages are provided, returns an incomplete Cffu.
    final <T> Cffu<T>
    anySuccessOf(CompletionStage<? extends T>... cfs)
    Returns a new Cffu that is successful when any of the given stages success, with the same result.
    builder(Executor defaultExecutor)
    Returns a CffuFactoryBuilder with defaultExecutor setting.
    static <T> CompletableFuture<T>[]
    cffuArrayUnwrap(Cffu<T>... cfs)
    A convenient util method for unwrap input Cffu array elements by Cffu.cffuUnwrap().
    static <T> Cffu<T>[]
    cffuListToArray(List<Cffu<T>> cffuList)
    Convert Cffu list to Cffu array.
    <T> Cffu<T>
    completedFuture(T value)
    Returns a new Cffu that is already completed with the given value.
    completedStage(T value)
    Returns a new CompletionStage that is already completed with the given value and supports only those methods in interface CompletionStage.
    Returns the default Executor used for async methods that do not specify an Executor.
    delayedExecutor(long delay, TimeUnit unit)
    Returns a new Executor that submits a task to the default executor after the given delay (or no delay if non-positive).
    delayedExecutor(long delay, TimeUnit unit, Executor executor)
    Returns a new Executor that submits a task to the given base executor after the given delay (or no delay if non-positive).
    <T> Cffu<T>
    Returns a new Cffu that is already completed exceptionally with the given exception.
    Returns a new CompletionStage that is already completed exceptionally with the given exception and supports only those methods in interface CompletionStage.
    boolean
    Returns forbidObtrudeMethods or not.
    final <T> Cffu<List<T>>
    mostSuccessResultsOf(T valueIfNotSuccess, long timeout, TimeUnit unit, CompletionStage<? extends T>... cfs)
    Returns a new Cffu with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    <T1, T2> Cffu<Tuple2<T1,T2>>
    mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
    Returns a new Cffu with the most results in the same order of the given two stages arguments in the given time(timeout, aka as many results as possible in the given time).
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
    Returns a new Cffu with the most results in the same order of the given three stages arguments in the given time(timeout, aka as many results as possible in the given time).
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
    Returns a new Cffu with the most results in the same order of the given four stages arguments in the given time(timeout, aka as many results as possible in the given time).
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
    Returns a new Cffu with the most results in the same order of the given five stages arguments in the given time(timeout, aka as many results as possible in the given time).
    mRunAnyAsync(Runnable... actions)
    Returns a new Cffu that is asynchronously completed when any tasks running in the Cffu's default asynchronous execution facility.
    mRunAnyAsync(Executor executor, Runnable... actions)
    Returns a new Cffu that is asynchronously completed when any tasks running in the given executor complete.
    Returns a new Cffu that is asynchronously successful when any tasks running in the Cffu's default asynchronous execution facility success.
    mRunAnySuccessAsync(Executor executor, Runnable... actions)
    Returns a new Cffu that is asynchronously completed when any tasks running in the Cffu's default asynchronous execution facility.
    mRunAsync(Runnable... actions)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility after runs the given actions.
    mRunAsync(Executor executor, Runnable... actions)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor after runs the given actions.
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility after runs the given actions.
    mRunFastFailAsync(Executor executor, Runnable... actions)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor after runs the given actions.
    final <T> Cffu<List<T>>
    mSupplyAllSuccessAsync(T valueIfFailed, Executor executor, Supplier<? extends T>... suppliers)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    final <T> Cffu<List<T>>
    mSupplyAllSuccessAsync(T valueIfFailed, Supplier<? extends T>... suppliers)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    final <T> Cffu<T>
    mSupplyAnyAsync(Executor executor, Supplier<? extends T>... suppliers)
    Returns a new Cffu that is completed when any of tasks running in the given Executor by calling the given Suppliers complete, with the same result.
    final <T> Cffu<T>
    mSupplyAnyAsync(Supplier<? extends T>... suppliers)
    Returns a new Cffu that is completed when any of tasks running in the Cffu's default asynchronous execution facility by calling the given Suppliers complete, with the same result.
    final <T> Cffu<T>
    mSupplyAnySuccessAsync(Executor executor, Supplier<? extends T>... suppliers)
    Returns a new Cffu that is asynchronously successful when any of tasks running in the given executor by calling the given Suppliers success, with the same result.
    final <T> Cffu<T>
    mSupplyAnySuccessAsync(Supplier<? extends T>... suppliers)
    Returns a new Cffu that is asynchronously successful when any of tasks running in the Cffu's default asynchronous execution facility by calling the given Suppliers success, with the same result.
    final <T> Cffu<List<T>>
    mSupplyAsync(Executor executor, Supplier<? extends T>... suppliers)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    final <T> Cffu<List<T>>
    mSupplyAsync(Supplier<? extends T>... suppliers)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    final <T> Cffu<List<T>>
    mSupplyFastFailAsync(Executor executor, Supplier<? extends T>... suppliers)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    final <T> Cffu<List<T>>
    mSupplyFastFailAsync(Supplier<? extends T>... suppliers)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    final <T> Cffu<List<T>>
    mSupplyMostSuccessAsync(T valueIfNotSuccess, long timeout, TimeUnit unit, Supplier<? extends T>... suppliers)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    final <T> Cffu<List<T>>
    mSupplyMostSuccessAsync(T valueIfNotSuccess, Executor executor, long timeout, TimeUnit unit, Supplier<? extends T>... suppliers)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    <T> Cffu<T>
    Return an incomplete Cffu, equivalent to CompletableFuture() constructor.
    Returns a new Cffu that is asynchronously completed by a task running in the defaultExecutor() after it runs the given action.
    runAsync(Runnable action, Executor executor)
    Returns a new Cffu that is asynchronously completed by a task running in the given executor after it runs the given action.
    <T> Cffu<T>
    supplyAsync(Supplier<T> supplier)
    Returns a new Cffu that is asynchronously completed by a task running in the defaultExecutor() with the value obtained by calling the given Supplier.
    <T> Cffu<T>
    supplyAsync(Supplier<T> supplier, Executor executor)
    Returns a new Cffu that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier.
    <T> Cffu<T>
    Returns a Cffu maintaining the same completion properties as this stage and this CffuFactory config.
    final <T> Cffu<T>[]
    A convenient util method for wrap input CompletableFuture / CompletionStage / Cffu array element by toCffu(CompletionStage).
    <T1, T2> Cffu<Tuple2<T1,T2>>
    tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new Cffu that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new Cffu that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new Cffu that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new Cffu that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2> Cffu<Tuple2<T1,T2>>
    tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2> Cffu<Tuple2<T1,T2>>
    tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2> Cffu<Tuple2<T1,T2>>
    tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2> Cffu<Tuple2<T1,T2>>
    tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2> Cffu<Tuple2<T1,T2>>
    tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    <T1, T2> Cffu<Tuple2<T1,T2>>
    tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    <T1, T2> Cffu<Tuple2<T1,T2>>
    tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    <T1, T2, T3>
    Cffu<Tuple3<T1,T2,T3>>
    tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4>
    Cffu<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    <T1, T2, T3, T4, T5>
    Cffu<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • builder

      @Contract(pure=true) public static CffuFactoryBuilder builder(Executor defaultExecutor)
      Returns a CffuFactoryBuilder with defaultExecutor setting.
      See Also:
    • newIncompleteCffu

      @Contract(pure=true) public <T> Cffu<T> newIncompleteCffu()
      Return an incomplete Cffu, equivalent to CompletableFuture() constructor.

      In general, should not use this method in biz code, prefer other factory methods of Cffu.

      See Also:
    • supplyAsync

      @CheckReturnValue(explanation="should use the returned Cffu; otherwise, prefer method `runAsync`") public <T> Cffu<T> supplyAsync(Supplier<T> supplier)
      Returns a new Cffu that is asynchronously completed by a task running in the defaultExecutor() with the value obtained by calling the given Supplier.
      Type Parameters:
      T - the function's return type
      Parameters:
      supplier - a function returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
    • supplyAsync

      @CheckReturnValue(explanation="should use the returned Cffu; otherwise, prefer method `runAsync`") public <T> Cffu<T> supplyAsync(Supplier<T> supplier, Executor executor)
      Returns a new Cffu that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier.
      Type Parameters:
      T - the function's return type
      Parameters:
      supplier - a function returning the value to be used to complete the returned Cffu
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
    • runAsync

      public Cffu<Void> runAsync(Runnable action)
      Returns a new Cffu that is asynchronously completed by a task running in the defaultExecutor() after it runs the given action.
      Parameters:
      action - the action to run before completing the returned Cffu
      Returns:
      the new Cffu
    • runAsync

      public Cffu<Void> runAsync(Runnable action, Executor executor)
      Returns a new Cffu that is asynchronously completed by a task running in the given executor after it runs the given action.
      Parameters:
      action - the action to run before completing the returned Cffu
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
    • mSupplyFastFailAsync

      @SafeVarargs public final <T> Cffu<List<T>> mSupplyFastFailAsync(Supplier<? extends T>... suppliers)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyFastFailAsync

      @SafeVarargs public final <T> Cffu<List<T>> mSupplyFastFailAsync(Executor executor, Supplier<? extends T>... suppliers)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyAllSuccessAsync

      @SafeVarargs public final <T> Cffu<List<T>> mSupplyAllSuccessAsync(@Nullable T valueIfFailed, Supplier<? extends T>... suppliers)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use the given valueIfFailed.

      Type Parameters:
      T - the suppliers' return type
      Parameters:
      valueIfFailed - the value to return if not failed
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyAllSuccessAsync

      @SafeVarargs public final <T> Cffu<List<T>> mSupplyAllSuccessAsync(@Nullable T valueIfFailed, Executor executor, Supplier<? extends T>... suppliers)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use the given valueIfFailed.

      Type Parameters:
      T - the suppliers' return type
      Parameters:
      valueIfFailed - the value to return if not failed
      executor - the executor to use for asynchronous execution
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyMostSuccessAsync

      @SafeVarargs public final <T> Cffu<List<T>> mSupplyMostSuccessAsync(@Nullable T valueIfNotSuccess, long timeout, TimeUnit unit, Supplier<? extends T>... suppliers)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Type Parameters:
      T - the suppliers' return type
      Parameters:
      valueIfNotSuccess - the value to return if not completed successfully
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyMostSuccessAsync

      @SafeVarargs public final <T> Cffu<List<T>> mSupplyMostSuccessAsync(@Nullable T valueIfNotSuccess, Executor executor, long timeout, TimeUnit unit, Supplier<? extends T>... suppliers)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Type Parameters:
      T - the suppliers' return type
      Parameters:
      valueIfNotSuccess - the value to return if not completed successfully
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyAsync

      @SafeVarargs public final <T> Cffu<List<T>> mSupplyAsync(Supplier<? extends T>... suppliers)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyAsync

      @SafeVarargs public final <T> Cffu<List<T>> mSupplyAsync(Executor executor, Supplier<? extends T>... suppliers)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyAnySuccessAsync

      @SafeVarargs public final <T> Cffu<T> mSupplyAnySuccessAsync(Supplier<? extends T>... suppliers)
      Returns a new Cffu that is asynchronously successful when any of tasks running in the Cffu's default asynchronous execution facility by calling the given Suppliers success, with the same result. Otherwise, all the given tasks complete exceptionally, the returned Cffu also does so, with a CompletionException holding an exception from any of the given stages as its cause. If no suppliers are provided, returns a new Cffu that is already completed exceptionally with a CompletionException holding a NoCfsProvidedException as its cause.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyAnySuccessAsync

      @SafeVarargs public final <T> Cffu<T> mSupplyAnySuccessAsync(Executor executor, Supplier<? extends T>... suppliers)
      Returns a new Cffu that is asynchronously successful when any of tasks running in the given executor by calling the given Suppliers success, with the same result. Otherwise, all the given tasks complete exceptionally, the returned Cffu also does so, with a CompletionException holding an exception from any of the given stages as its cause. If no suppliers are provided, returns a new Cffu that is already completed exceptionally with a CompletionException holding a NoCfsProvidedException as its cause.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyAnyAsync

      @SafeVarargs public final <T> Cffu<T> mSupplyAnyAsync(Supplier<? extends T>... suppliers)
      Returns a new Cffu that is completed when any of tasks running in the Cffu's default asynchronous execution facility by calling the given Suppliers complete, with the same result. Otherwise, if it completed exceptionally, the returned Cffu also does so, with a CompletionException holding this exception as its cause. If no suppliers are provided, returns an incomplete Cffu.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mSupplyAnyAsync

      @SafeVarargs public final <T> Cffu<T> mSupplyAnyAsync(Executor executor, Supplier<? extends T>... suppliers)
      Returns a new Cffu that is completed when any of tasks running in the given Executor by calling the given Suppliers complete, with the same result. Otherwise, if it completed exceptionally, the returned Cffu also does so, with a CompletionException holding this exception as its cause. If no suppliers are provided, returns an incomplete Cffu.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      suppliers - the suppliers returning the value to be used to complete the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mRunFastFailAsync

      public Cffu<Void> mRunFastFailAsync(Runnable... actions)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility after runs the given actions.
      Parameters:
      actions - the actions to run before completing the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mRunFastFailAsync

      public Cffu<Void> mRunFastFailAsync(Executor executor, Runnable... actions)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor after runs the given actions.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to run before completing the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mRunAsync

      public Cffu<Void> mRunAsync(Runnable... actions)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility after runs the given actions.
      Parameters:
      actions - the actions to run before completing the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mRunAsync

      public Cffu<Void> mRunAsync(Executor executor, Runnable... actions)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor after runs the given actions.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to run before completing the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mRunAnySuccessAsync

      public Cffu<Void> mRunAnySuccessAsync(Runnable... actions)
      Returns a new Cffu that is asynchronously successful when any tasks running in the Cffu's default asynchronous execution facility success.
      Parameters:
      actions - the actions to run before completing the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mRunAnySuccessAsync

      public Cffu<Void> mRunAnySuccessAsync(Executor executor, Runnable... actions)
      Returns a new Cffu that is asynchronously completed when any tasks running in the Cffu's default asynchronous execution facility.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to run before completing the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mRunAnyAsync

      public Cffu<Void> mRunAnyAsync(Runnable... actions)
      Returns a new Cffu that is asynchronously completed when any tasks running in the Cffu's default asynchronous execution facility.
      Parameters:
      actions - the actions to run before completing the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • mRunAnyAsync

      public Cffu<Void> mRunAnyAsync(Executor executor, Runnable... actions)
      Returns a new Cffu that is asynchronously completed when any tasks running in the given executor complete.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to run before completing the returned Cffu
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyFastFailAsync

      public <T1, T2> Cffu<Tuple2<T1,T2>> tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyFastFailAsync

      public <T1, T2> Cffu<Tuple2<T1,T2>> tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyFastFailAsync

      public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyFastFailAsync

      public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyFastFailAsync

      public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyFastFailAsync

      public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyFastFailAsync

      public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyFastFailAsync

      public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyAllSuccessAsync

      public <T1, T2> Cffu<Tuple2<T1,T2>> tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Returns:
      the new Cffu
    • tupleMSupplyAllSuccessAsync

      public <T1, T2> Cffu<Tuple2<T1,T2>> tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new Cffu that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
    • tupleMSupplyAllSuccessAsync

      public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Returns:
      the new Cffu
    • tupleMSupplyAllSuccessAsync

      public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new Cffu that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
    • tupleMSupplyAllSuccessAsync

      public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Returns:
      the new Cffu
    • tupleMSupplyAllSuccessAsync

      public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new Cffu that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
    • tupleMSupplyAllSuccessAsync

      public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Returns:
      the new Cffu
    • tupleMSupplyAllSuccessAsync

      public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new Cffu that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
    • tupleMSupplyMostSuccessAsync

      public <T1, T2> Cffu<Tuple2<T1,T2>> tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new Cffu
    • tupleMSupplyMostSuccessAsync

      public <T1, T2> Cffu<Tuple2<T1,T2>> tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new Cffu
    • tupleMSupplyMostSuccessAsync

      public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new Cffu
    • tupleMSupplyMostSuccessAsync

      public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new Cffu
    • tupleMSupplyMostSuccessAsync

      public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new Cffu
    • tupleMSupplyMostSuccessAsync

      public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new Cffu
    • tupleMSupplyMostSuccessAsync

      public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new Cffu
    • tupleMSupplyMostSuccessAsync

      public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new Cffu
    • tupleMSupplyAsync

      public <T1, T2> Cffu<Tuple2<T1,T2>> tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyAsync

      public <T1, T2> Cffu<Tuple2<T1,T2>> tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyAsync

      public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyAsync

      public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyAsync

      public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyAsync

      public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyAsync

      public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new Cffu that is asynchronously completed by tasks running in the defaultExecutor() with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new Cffu
      See Also:
    • tupleMSupplyAsync

      public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new Cffu that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new Cffu
      See Also:
    • allResultsFastFailOf

      @Contract(pure=true) @SafeVarargs public final <T> Cffu<List<T>> allResultsFastFailOf(CompletionStage<? extends T>... cfs)
      Returns a new Cffu that is successful with the results in the same order of the given stages arguments when all the given stages success; If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause. If no stages are provided, returns a Cffu completed with the value empty list.

      This method is the same as allResultsOf(CompletionStage[]) except for the fast-fail behavior.

      Parameters:
      cfs - the stages
      Returns:
      a new Cffu that is successful when all the given stages success
      Throws:
      NullPointerException - if the array or any of its elements are null
    • allSuccessResultsOf

      @Contract(pure=true) @SafeVarargs public final <T> Cffu<List<T>> allSuccessResultsOf(@Nullable T valueIfFailed, CompletionStage<? extends T>... cfs)
      Returns a new Cffu that is successful with the results in the same order of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed. If no stages are provided, returns a Cffu completed with the value empty list.
      Parameters:
      valueIfFailed - the value to return if not completed successfully
      cfs - the stages
      Throws:
      NullPointerException - if the array or any of its elements are null
    • mostSuccessResultsOf

      @Contract(pure=true) @SafeVarargs public final <T> Cffu<List<T>> mostSuccessResultsOf(@Nullable T valueIfNotSuccess, long timeout, TimeUnit unit, CompletionStage<? extends T>... cfs)
      Returns a new Cffu with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      valueIfNotSuccess - the value to return if not completed successfully
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      cfs - the stages
      See Also:
    • allResultsOf

      @Contract(pure=true) @SafeVarargs public final <T> Cffu<List<T>> allResultsOf(CompletionStage<? extends T>... cfs)
      Returns a new Cffu with the results in the same order of the given stages arguments, the new Cffu is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause. If no stages are provided, returns a Cffu completed with the value empty list.

      This method is the same as allOf(CompletionStage[]), except that the returned Cffu contains the results of the given stages.

      Parameters:
      cfs - the stages
      Returns:
      a new Cffu that is completed when all the given stages complete
      Throws:
      NullPointerException - if the array or any of its elements are null
    • allFastFailOf

      @Contract(pure=true) public Cffu<Void> allFastFailOf(CompletionStage<?>... cfs)
      Returns a new Cffu that is successful when all the given stages success; If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause. Otherwise, the results of the given stages are not reflected in the returned Cffu(Cffu<Void>), but may be obtained by inspecting them individually. If no stages are provided, returns a Cffu completed with the value null.

      This method is the same as allOf(CompletionStage[]) except for the fast-fail behavior.

      If you need the results of given stages, prefer below methods:

      If you need the successful results of given stages in the given time, prefer below methods:

      Parameters:
      cfs - the stages
      Returns:
      a new Cffu that is successful when all the given stages success
      Throws:
      NullPointerException - if the array or any of its elements are null
    • allOf

      @Contract(pure=true) public Cffu<Void> allOf(CompletionStage<?>... cfs)
      Returns a new Cffu that is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause. Otherwise, the results, if any, of the given stages are not reflected in the returned Cffu(Cffu<Void>), but may be obtained by inspecting them individually. If no stages are provided, returns a Cffu completed with the value null.

      This method is the same as CompletableFuture.allOf(CompletableFuture[]), except that the parameter type is more generic CompletionStage instead of CompletableFuture.

      If you need the results of given stages, prefer below methods:

      If you need the successful results of given stages in the given time, prefer below methods:

      Parameters:
      cfs - the stages
      Returns:
      a new Cffu that is completed when all the given stages complete
      Throws:
      NullPointerException - if the array or any of its elements are null
    • anySuccessOf

      @SafeVarargs public final <T> Cffu<T> anySuccessOf(CompletionStage<? extends T>... cfs)
      Returns a new Cffu that is successful when any of the given stages success, with the same result. Otherwise, all the given stages complete exceptionally, the returned Cffu also does so, with a CompletionException holding an exception from any of the given stages as its cause. If no stages are provided, returns a new Cffu that is already completed exceptionally with a CompletionException holding a NoCfsProvidedException as its cause.

      This method is the same as anyOf(CompletionStage[]) except for the any-success behavior instead of any-complete.

      Parameters:
      cfs - the stages
      Returns:
      a new Cffu that is successful when any of the given stages success, with the same result
      Throws:
      NullPointerException - if the array or any of its elements are null
    • anyOf

      @Contract(pure=true) @SafeVarargs public final <T> Cffu<T> anyOf(CompletionStage<? extends T>... cfs)
      Returns a new Cffu that is completed when any of the given stages complete, with the same result.
      Otherwise, if it completed exceptionally, the returned Cffu also does so, with a CompletionException holding this exception as its cause.
      If no stages are provided, returns an incomplete Cffu.

      This method is the same as CompletableFuture.anyOf(CompletableFuture[]), except that the parameter type is more generic CompletionStage instead of CompletableFuture, and the return type is more specific T instead of Object.

      Parameters:
      cfs - the stages
      Returns:
      a new Cffu that is completed with the result or exception from any of the given stages when one completes
      Throws:
      NullPointerException - if the array or any of its elements are null
    • allTupleFastFailOf

      @Contract(pure=true) public <T1, T2> Cffu<Tuple2<T1,T2>> allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
      Returns a new Cffu that is successful when the given two stages success. If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
      Returns:
      a new Cffu that is successful when the given two stages success
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleFastFailOf

      @Contract(pure=true) public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
      Returns a new Cffu that is successful when the given three stages success. If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
      Returns:
      a new Cffu that is successful when the given three stages success
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleFastFailOf

      @Contract(pure=true) public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
      Returns a new Cffu that is successful when the given four stages success. If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
      Returns:
      a new Cffu that is successful when the given four stages success
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleFastFailOf

      @Contract(pure=true) public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
      Returns a new Cffu that is successful when the given five stages success. If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
      Returns:
      a new Cffu that is successful when the given five stages success
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allSuccessTupleOf

      @Contract(pure=true) public <T1, T2> Cffu<Tuple2<T1,T2>> allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
      Returns a new Cffu that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
      Returns:
      a new Cffu
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allSuccessTupleOf

      @Contract(pure=true) public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
      Returns a new Cffu that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
      Returns:
      a new Cffu
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allSuccessTupleOf

      @Contract(pure=true) public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
      Returns a new Cffu that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
      Returns:
      a new Cffu
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allSuccessTupleOf

      @Contract(pure=true) public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
      Returns a new Cffu that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
      Returns:
      a new Cffu
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public <T1, T2> Cffu<Tuple2<T1,T2>> mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
      Returns a new Cffu with the most results in the same order of the given two stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new Cffu that is completed when the given two stages complete
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
      Returns a new Cffu with the most results in the same order of the given three stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new Cffu that is completed when the given three stages complete
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
      Returns a new Cffu with the most results in the same order of the given four stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new Cffu that is completed when the given four stages complete
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
      Returns a new Cffu with the most results in the same order of the given five stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new Cffu that is completed when the given five stages complete
      See Also:
    • allTupleOf

      @Contract(pure=true) public <T1, T2> Cffu<Tuple2<T1,T2>> allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
      Returns a new Cffu that is completed when the given two stages complete. If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.
      Returns:
      a new Cffu that is completed when the given two stages complete
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleOf

      @Contract(pure=true) public <T1, T2, T3> Cffu<Tuple3<T1,T2,T3>> allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
      Returns a new Cffu that is completed when the given three stages complete. If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.
      Returns:
      a new Cffu that is completed when the given three stages complete
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleOf

      @Contract(pure=true) public <T1, T2, T3, T4> Cffu<Tuple4<T1,T2,T3,T4>> allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
      Returns a new Cffu that is completed when the given four stages complete. If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.
      Returns:
      a new Cffu that is completed when the given four stages complete
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleOf

      @Contract(pure=true) public <T1, T2, T3, T4, T5> Cffu<Tuple5<T1,T2,T3,T4,T5>> allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
      Returns a new Cffu that is completed when the given five stages complete. If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.
      Returns:
      a new Cffu that is completed when the given five stages complete
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • completedFuture

      @Contract(pure=true) public <T> Cffu<T> completedFuture(@Nullable T value)
      Returns a new Cffu that is already completed with the given value.
      Type Parameters:
      T - the type of the value
      Parameters:
      value - the value
      Returns:
      the completed Cffu
    • completedStage

      @Contract(pure=true) public <T> CompletionStage<T> completedStage(@Nullable T value)
      Returns a new CompletionStage that is already completed with the given value and supports only those methods in interface CompletionStage.

      CAUTION:
      if run on old Java 8, just return a Cffu with a *normal* underlying CompletableFuture which is NOT with a *minimal* CompletionStage.

      Type Parameters:
      T - the type of the value
      Parameters:
      value - the value
      Returns:
      the completed CompletionStage
    • failedFuture

      @Contract(pure=true) public <T> Cffu<T> failedFuture(Throwable ex)
      Returns a new Cffu that is already completed exceptionally with the given exception.
      Type Parameters:
      T - the type of the value
      Parameters:
      ex - the exception
      Returns:
      the exceptionally completed Cffu
    • failedStage

      @Contract(pure=true) public <T> CompletionStage<T> failedStage(Throwable ex)
      Returns a new CompletionStage that is already completed exceptionally with the given exception and supports only those methods in interface CompletionStage.

      CAUTION:
      if run on old Java 8, just return a Cffu with a *normal* underlying CompletableFuture which is NOT with a *minimal* CompletionStage.

      Type Parameters:
      T - the type of the value
      Parameters:
      ex - the exception
      Returns:
      the exceptionally completed CompletionStage
    • toCffu

      @Contract(pure=true) public <T> Cffu<T> toCffu(CompletionStage<T> stage)
      Returns a Cffu maintaining the same completion properties as this stage and this CffuFactory config. If this stage is already a Cffu and have the same CffuFactory, this method may return this stage itself.
      Throws:
      NullPointerException - if the given stage is null
      See Also:
    • toCffuArray

      @Contract(pure=true) @SafeVarargs public final <T> Cffu<T>[] toCffuArray(CompletionStage<T>... stages)
      A convenient util method for wrap input CompletableFuture / CompletionStage / Cffu array element by toCffu(CompletionStage).
      Throws:
      NullPointerException - if the array or any of its elements are null
      See Also:
    • delayedExecutor

      @Contract(pure=true) public Executor delayedExecutor(long delay, TimeUnit unit)
      Returns a new Executor that submits a task to the default executor after the given delay (or no delay if non-positive). Each delay commences upon invocation of the returned executor's execute method.
      Parameters:
      delay - how long to delay, in units of unit
      unit - a TimeUnit determining how to interpret the delay parameter
      Returns:
      the new delayed executor
    • delayedExecutor

      @Contract(pure=true) public Executor delayedExecutor(long delay, TimeUnit unit, Executor executor)
      Returns a new Executor that submits a task to the given base executor after the given delay (or no delay if non-positive). Each delay commences upon invocation of the returned executor's execute method.
      Parameters:
      delay - how long to delay, in units of unit
      unit - a TimeUnit determining how to interpret the delay parameter
      executor - the base executor
      Returns:
      the new delayed executor
    • cffuArrayUnwrap

      @Contract(pure=true) @SafeVarargs public static <T> CompletableFuture<T>[] cffuArrayUnwrap(Cffu<T>... cfs)
      A convenient util method for unwrap input Cffu array elements by Cffu.cffuUnwrap().
      Parameters:
      cfs - the Cffus
      See Also:
    • cffuListToArray

      @Contract(pure=true) public static <T> Cffu<T>[] cffuListToArray(List<Cffu<T>> cffuList)
      Convert Cffu list to Cffu array.
      See Also:
    • defaultExecutor

      @Contract(pure=true) public Executor defaultExecutor()
      Returns the default Executor used for async methods that do not specify an Executor. Configured by builder(Executor).
      Returns:
      the default executor
      See Also:
    • forbidObtrudeMethods

      @Contract(pure=true) public boolean forbidObtrudeMethods()
      Returns forbidObtrudeMethods or not.
      See Also: