Uses of Class
io.foldright.cffu.Cffu
Packages that use Cffu
Package
Description
A tiny 0-dependency sidekick library for CompletableFuture
to improve user experience and reduce misuse.
-
Uses of Cffu in io.foldright.cffu
Methods in io.foldright.cffu that return CffuModifier and TypeMethodDescriptionCffu.acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action) Returns a new Cffu that, when either this or the other given stage complete normally, is executed with the corresponding result as argument to the supplied action.Cffu.acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) Returns a new Cffu that, when either this or the other given stage complete normally, is executed usingdefaultExecutor(), with the corresponding result as argument to the supplied action.Cffu.acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) Returns a new Cffu that, when either this or the other given stage complete normally, is executed using the supplied executor, with the corresponding result as argument to the supplied action.CffuFactory.allOf()Provided this overloaded method just for resolving "allOf is ambiguous" problem when callallOfwith empty arguments:cffuFactory.allOf().Returns a new Cffu that is completed when all the given Cffus complete.CffuFactory.allOf(CompletableFuture<?>... cfs) Returns a new Cffu that is completed when all the given CompletableFutures complete.CffuFactory.allOfFastFail()Provided this overloaded method just for resolving "allOfFastFail is ambiguous" problem when callallOfFastFailwith empty arguments:cffuFactory.allOfFastFail().CffuFactory.allOfFastFail(Cffu<?>... cfs) Returns a new Cffu that success when all the given Cffus success, the results(Cffu<Void>) of the given Cffus are not reflected in the returned Cffu, but may be obtained by inspecting them individually.CffuFactory.allOfFastFail(CompletableFuture<?>... cfs) Returns a new Cffu that success when all the given CompletableFutures success, the results(Cffu<Void>) of the given CompletableFutures are not reflected in the returned Cffu, but may be obtained by inspecting them individually.CffuFactory.anyOf()Provided this overloaded method just for resolving "anyOf is ambiguous" problem when callanyOfwith empty arguments:cffuFactory.anyOf().Returns a new Cffu that is completed when any of the given Cffus 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 Cffus are provided, returns an incomplete Cffu.CffuFactory.anyOf(CompletableFuture<?>... cfs) Same asCffuFactory.anyOf(Cffu[])with overloaded argument typeCompletableFuture.CffuFactory.anyOfSuccess()Provided this overloaded method just for resolving "cffuAnyOfSuccess is ambiguous" problem when callanyOfSuccesswith empty arguments:cffuFactory.anyOfSuccess().CffuFactory.anyOfSuccess(Cffu<?>... cfs) Returns a new Cffu that success when any of the given Cffus success, with the same result.CffuFactory.anyOfSuccess(CompletableFuture<?>... cfs) Returns a new Cffu that success when any of the given CompletableFutures success, with the same result.<U> Cffu<U>Cffu.applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) Returns a new Cffu that, when either this or the other given stage complete normally, is executed with the corresponding result as argument to the supplied function.<U> Cffu<U>Cffu.applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn) Returns a new Cffu that, when either this or the other given stage complete normally, is executed usingdefaultExecutor(), with the corresponding result as argument to the supplied function.<U> Cffu<U>Cffu.applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) Returns a new Cffu that, when either this or the other given stage complete normally, is executed using the supplied executor, with the corresponding result as argument to the supplied function.<T> Cffu<T>CffuFactory.asCffu(CompletionStage<T> stage) final <T> Cffu<T>[]CffuFactory.asCffuArray(CompletionStage<T>... stages) A convenient util method for wrap inputCompletableFuture/CompletionStage/Cffuarray element byCffuFactory.asCffu(CompletionStage).CffuFactory.cffuAllOf()Provided this overloaded method just for resolving "cffuAllOf is ambiguous" problem when callcffuAllOfwith empty arguments:cffuFactory.cffuAllOf().Returns a new Cffu with the results of all the given Cffus, the new Cffu is completed when all the given Cffus complete.CffuFactory.cffuAllOf(CompletableFuture<T>... cfs) Returns a new Cffu with the results of all the given CompletableFutures, the new Cffu is completed when all the given CompletableFutures complete.CffuFactory.cffuAllOfFastFail()Provided this overloaded method just for resolving "cffuAllOfFastFail is ambiguous" problem when callcffuAllOfFastFailwith empty arguments:cffuFactory.cffuAllOfFastFail().CffuFactory.cffuAllOfFastFail(Cffu<T>... cfs) Returns a new Cffu with the results of all the given Cffus, the new Cffu success when all the given Cffus success.CffuFactory.cffuAllOfFastFail(CompletableFuture<T>... cfs) Returns a new Cffu with the results of all the given CompletableFutures, the new Cffu success when all the given CompletableFutures success.<T> Cffu<T>CffuFactory.cffuAnyOf()Provided this overloaded method just for resolving "cffuAnyOf is ambiguous" problem when callcffuAnyOfwith empty arguments:cffuFactory.cffuAnyOf().final <T> Cffu<T>Returns a new Cffu that is completed when any of the given Cffus complete, with the same result.final <T> Cffu<T>CffuFactory.cffuAnyOf(CompletableFuture<T>... cfs) Returns a new Cffu that is completed when any of the given CompletableFutures complete, with the same result.<T> Cffu<T>CffuFactory.cffuAnyOfSuccess()Provided this overloaded method just for resolving "cffuAnyOfSuccess is ambiguous" problem when callcffuAnyOfSuccesswith empty arguments:cffuFactory.cffuAnyOfSuccess().final <T> Cffu<T>CffuFactory.cffuAnyOfSuccess(Cffu<T>... cfs) Returns a new Cffu that success when any of the given Cffus success, with the same result.final <T> Cffu<T>CffuFactory.cffuAnyOfSuccess(CompletableFuture<T>... cfs) Returns a new Cffu that success when any of the given CompletableFutures success, with the same result.Cffu.cffuCombine(Cffu<T2> cf2) Same asCffuFactory.cffuCombine(Cffu, Cffu), providing this method is convenient for method chaining.Cffu.cffuCombine(Cffu<T2> cf2, Cffu<T3> cf3) Same asCffuFactory.cffuCombine(Cffu, Cffu, Cffu), providing this method is convenient for method chaining.Cffu.cffuCombine(Cffu<T2> cf2, Cffu<T3> cf3, Cffu<T4> cf4) Same asCffuFactory.cffuCombine(Cffu, Cffu, Cffu, Cffu), providing this method is convenient for method chaining.Cffu.cffuCombine(Cffu<T2> cf2, Cffu<T3> cf3, Cffu<T4> cf4, Cffu<T5> cf5) Same asCffuFactory.cffuCombine(Cffu, Cffu, Cffu, Cffu, Cffu), providing this method is convenient for method chaining.Cffu.cffuCombine(CompletableFuture<T2> cf2) Same asCffuFactory.cffuCombine(CompletableFuture, CompletableFuture), providing this method is convenient for method chaining.Cffu.cffuCombine(CompletableFuture<T2> cf2, CompletableFuture<T3> cf3) Same asCffuFactory.cffuCombine(CompletableFuture, CompletableFuture, CompletableFuture), providing this method is convenient for method chaining.Cffu.cffuCombine(CompletableFuture<T2> cf2, CompletableFuture<T3> cf3, CompletableFuture<T4> cf4) Same asCffuFactory.cffuCombine(CompletableFuture, CompletableFuture, CompletableFuture, CompletableFuture), providing this method is convenient for method chaining.Cffu.cffuCombine(CompletableFuture<T2> cf2, CompletableFuture<T3> cf3, CompletableFuture<T4> cf4, CompletableFuture<T5> cf5) Same asCffuFactory.cffuCombine(CompletableFuture, CompletableFuture, CompletableFuture, CompletableFuture, CompletableFuture), providing this method is convenient for method chaining.CffuFactory.cffuCombine(Cffu<T1> cf1, Cffu<T2> cf2) Returns a new Cffu that is completed when the given two Cffus complete.CffuFactory.cffuCombine(Cffu<T1> cf1, Cffu<T2> cf2, Cffu<T3> cf3) Returns a new Cffu that is completed when the given three Cffus complete.CffuFactory.cffuCombine(Cffu<T1> cf1, Cffu<T2> cf2, Cffu<T3> cf3, Cffu<T4> cf4) Returns a new Cffu that is completed when the given 4 Cffus complete.Returns a new Cffu that is completed when the given 5 Cffus complete.CffuFactory.cffuCombine(CompletableFuture<T1> cf1, CompletableFuture<T2> cf2) Returns a new Cffu that is completed when the given two CompletableFutures complete.CffuFactory.cffuCombine(CompletableFuture<T1> cf1, CompletableFuture<T2> cf2, CompletableFuture<T3> cf3) Returns a new Cffu that is completed when the given three CompletableFutures complete.CffuFactory.cffuCombine(CompletableFuture<T1> cf1, CompletableFuture<T2> cf2, CompletableFuture<T3> cf3, CompletableFuture<T4> cf4) Returns a new Cffu that is completed when the given 4 CompletableFutures complete.CffuFactory.cffuCombine(CompletableFuture<T1> cf1, CompletableFuture<T2> cf2, CompletableFuture<T3> cf3, CompletableFuture<T4> cf4, CompletableFuture<T5> cf5) Returns a new Cffu that is completed when the given 5 CompletableFutures complete.static <T> Cffu<T>[]CffuFactory.cffuListToArray(List<Cffu<T>> cffuList) Convert Cffu list to Cffu array.Cffu.completeAsync(Supplier<? extends T> supplier) Completes this Cffu with the result of the given Supplier function invoked from an asynchronous task usingdefaultExecutor().Cffu.completeAsync(Supplier<? extends T> supplier, Executor executor) Completes this Cffu with the result of the given Supplier function invoked from an asynchronous task using the given executor.<T> Cffu<T>CffuFactory.completedFuture(T value) Returns a new Cffu that is already completed with the given value.Cffu.completeOnTimeout(T value, long timeout, TimeUnit unit) Completes this Cffu with the given value if not otherwise completed before the given timeout.Cffu.copy()Returns a new Cffu that is completed normally with the same value as this Cffu when it completes normally.Cffu.exceptionally(Function<Throwable, ? extends T> fn) Returns a new Cffu that, when this stage completes exceptionally, is executed with this stage's exception as the argument to the supplied function.Cffu.exceptionallyAsync(Function<Throwable, ? extends T> fn) Returns a new Cffu that, when this stage completes exceptionally, is executed with this stage's exception as the argument to the supplied function, usingdefaultExecutor().Cffu.exceptionallyAsync(Function<Throwable, ? extends T> fn, Executor executor) Returns a new Cffu that, when this stage completes exceptionally, is executed with this stage's exception as the argument to the supplied function, using the supplied Executor.Cffu.exceptionallyCompose(Function<Throwable, ? extends CompletionStage<T>> fn) Returns a new CompletionStage that, when this stage completes exceptionally, is composed using the results of the supplied function applied to this stage's exception.Cffu.exceptionallyComposeAsync(Function<Throwable, ? extends CompletionStage<T>> fn) Returns a new Cffu that, when this stage completes exceptionally, is composed using the results of the supplied function applied to this stage's exception, usingdefaultExecutor().Cffu.exceptionallyComposeAsync(Function<Throwable, ? extends CompletionStage<T>> fn, Executor executor) Returns a new Cffu that, when this stage completes exceptionally, is composed using the results of the supplied function applied to this stage's exception, using the supplied Executor.<T> Cffu<T>CffuFactory.failedFuture(Throwable ex) Returns a new Cffu that is already completed exceptionally with the given exception.<U> Cffu<U>Cffu.handle(BiFunction<? super T, Throwable, ? extends U> fn) Returns a new Cffu that, when this stage completes either normally or exceptionally, is executed with this stage's result and exception as arguments to the supplied function.<U> Cffu<U>Cffu.handleAsync(BiFunction<? super T, Throwable, ? extends U> fn) Returns a new Cffu that, when this stage completes either normally or exceptionally, is executed usingdefaultExecutor(), with this stage's result and exception as arguments to the supplied function.<U> Cffu<U>Cffu.handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) Returns a new Cffu that, when this stage completes either normally or exceptionally, is executed using the supplied executor, with this stage's result and exception as arguments to the supplied function.<T> Cffu<T>CffuFactory.newIncompleteCffu()Return an incomplete Cffu, equivalent toCompletableFuture()constructor.<U> Cffu<U>Cffu.newIncompleteFuture()Returns a new incomplete Cffu with CompletableFuture of the type to be returned by a CompletionStage method.Exceptionally completes this Cffu with aTimeoutExceptionif not otherwise completed before the given timeout.Cffu.resetCffuFactory(CffuFactory cffuFactory) Returns a new Cffu with given CffuFactory(contained configuration) that is completed normally with the same value as this Cffu when it completes normally.Cffu.runAfterBoth(CompletionStage<?> other, Runnable action) Returns a new Cffu that, when this and the other given stage both complete normally, executes the given action.Cffu.runAfterBothAsync(CompletionStage<?> other, Runnable action) Returns a new Cffu that, when this and the other given stage both complete normally, executes the given action usingdefaultExecutor().Cffu.runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) Returns a new Cffu that, when this and the other given stage both complete normally, executes the given action using the supplied executor.Cffu.runAfterEither(CompletionStage<?> other, Runnable action) Returns a new Cffu that, when either this or the other given stage complete normally, executes the given action.Cffu.runAfterEitherAsync(CompletionStage<?> other, Runnable action) Returns a new Cffu that, when either this or the other given stage complete normally, executes the given action usingdefaultExecutor().Cffu.runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) Returns a new Cffu that, when either this or the other given stage complete normally, executes the given action using the supplied executor.Returns a new Cffu that is asynchronously completed by a task running in theCffuFactory.defaultExecutor()after it runs the given action.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>CffuFactory.supplyAsync(Supplier<T> supplier) Returns a new Cffu that is asynchronously completed by a task running in theCffuFactory.defaultExecutor()with the value obtained by calling the given Supplier.<T> Cffu<T>CffuFactory.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.Cffu.thenAccept(Consumer<? super T> action) Returns a new Cffu that, when this stage completes normally, is executed with this stage's result as the argument to the supplied action.Cffu.thenAcceptAsync(Consumer<? super T> action) Returns a new Cffu that, when this stage completes normally, is executed usingdefaultExecutor(), with this stage's result as the argument to the supplied action.Cffu.thenAcceptAsync(Consumer<? super T> action, Executor executor) Returns a new Cffu that, when this stage completes normally, is executed using the supplied Executor, with this stage's result as the argument to the supplied action.Cffu.thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) Returns a new Cffu that, when this and the other given stage both complete normally, is executed with the two results as arguments to the supplied action.Cffu.thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) Returns a new Cffu that, when this and the other given stage both complete normally, is executed usingdefaultExecutor(), with the two results as arguments to the supplied action.Cffu.thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) Returns a new Cffu that, when this and the other given stage both complete normally, is executed using the supplied executor, with the two results as arguments to the supplied action.<U> Cffu<U>Returns a new Cffu that, when this stage completes normally, is executed with this stage's result as the argument to the supplied function.<U> Cffu<U>Cffu.thenApplyAsync(Function<? super T, ? extends U> fn) Returns a new Cffu that, when this stage completes normally, is executed usingdefaultExecutor(), with this stage's result as the argument to the supplied function.<U> Cffu<U>Cffu.thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor) Returns a new Cffu that, when this stage completes normally, is executed using the supplied Executor, with this stage's result as the argument to the supplied function.<U,V> Cffu<V> Cffu.thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) Returns a new Cffu that, when this and the other given stage both complete normally, is executed with the two results as arguments to the supplied function.<U,V> Cffu<V> Cffu.thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) Returns a new Cffu that, when this and the other given stage both complete normally, is executed usingdefaultExecutor(), with the two results as arguments to the supplied function.<U,V> Cffu<V> Cffu.thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) Returns a new Cffu that, when this and the other given stage both complete normally, is executed using the supplied executor, with the two results as arguments to the supplied function.<U> Cffu<U>Cffu.thenCompose(Function<? super T, ? extends CompletionStage<U>> fn) Returns a new Cffu that is completed with the same value as the CompletionStage returned by the given function.<U> Cffu<U>Cffu.thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn) Returns a new Cffu that is completed with the same value as the CompletionStage returned by the given function, executed usingdefaultExecutor().<U> Cffu<U>Cffu.thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor) Returns a new Cffu that is completed with the same value as the CompletionStage returned by the given function, executed using the supplied Executor.Returns a new Cffu that, when this stage completes normally, executes the given action.Cffu.thenRunAsync(Runnable action) Returns a new Cffu that, when this stage completes normally, executes the given action usingdefaultExecutor().Cffu.thenRunAsync(Runnable action, Executor executor) Returns a new Cffu that, when this stage completes normally, executes the given action using the supplied Executor.Cffu.whenComplete(BiConsumer<? super T, ? super Throwable> action) Returns a new Cffu with the same result or exception as this stage, that executes the given action when this stage completes.Cffu.whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action) Returns a new Cffu with the same result or exception as this stage, that executes the given action usingdefaultExecutor()when this stage completes.Cffu.whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) Returns a new Cffu with the same result or exception as this stage, that executes the given action using the supplied Executor when this stage completes.Methods in io.foldright.cffu with parameters of type CffuModifier and TypeMethodDescriptionReturns a new Cffu that is completed when all the given Cffus complete.CffuFactory.allOfFastFail(Cffu<?>... cfs) Returns a new Cffu that success when all the given Cffus success, the results(Cffu<Void>) of the given Cffus are not reflected in the returned Cffu, but may be obtained by inspecting them individually.Returns a new Cffu that is completed when any of the given Cffus 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 Cffus are provided, returns an incomplete Cffu.CffuFactory.anyOfSuccess(Cffu<?>... cfs) Returns a new Cffu that success when any of the given Cffus success, with the same result.Returns a new Cffu with the results of all the given Cffus, the new Cffu is completed when all the given Cffus complete.CffuFactory.cffuAllOfFastFail(Cffu<T>... cfs) Returns a new Cffu with the results of all the given Cffus, the new Cffu success when all the given Cffus success.final <T> Cffu<T>Returns a new Cffu that is completed when any of the given Cffus complete, with the same result.final <T> Cffu<T>CffuFactory.cffuAnyOfSuccess(Cffu<T>... cfs) Returns a new Cffu that success when any of the given Cffus success, with the same result.static <T> CompletableFuture<T>[]CffuFactory.cffuArrayUnwrap(Cffu<T>... cfs) A convenient util method for unwrap inputCffuarray elements bycffuUnwrap().Cffu.cffuCombine(Cffu<T2> cf2) Same asCffuFactory.cffuCombine(Cffu, Cffu), providing this method is convenient for method chaining.Cffu.cffuCombine(Cffu<T2> cf2, Cffu<T3> cf3) Same asCffuFactory.cffuCombine(Cffu, Cffu, Cffu), providing this method is convenient for method chaining.Cffu.cffuCombine(Cffu<T2> cf2, Cffu<T3> cf3, Cffu<T4> cf4) Same asCffuFactory.cffuCombine(Cffu, Cffu, Cffu, Cffu), providing this method is convenient for method chaining.Cffu.cffuCombine(Cffu<T2> cf2, Cffu<T3> cf3, Cffu<T4> cf4, Cffu<T5> cf5) Same asCffuFactory.cffuCombine(Cffu, Cffu, Cffu, Cffu, Cffu), providing this method is convenient for method chaining.CffuFactory.cffuCombine(Cffu<T1> cf1, Cffu<T2> cf2) Returns a new Cffu that is completed when the given two Cffus complete.CffuFactory.cffuCombine(Cffu<T1> cf1, Cffu<T2> cf2, Cffu<T3> cf3) Returns a new Cffu that is completed when the given three Cffus complete.CffuFactory.cffuCombine(Cffu<T1> cf1, Cffu<T2> cf2, Cffu<T3> cf3, Cffu<T4> cf4) Returns a new Cffu that is completed when the given 4 Cffus complete.Returns a new Cffu that is completed when the given 5 Cffus complete.Method parameters in io.foldright.cffu with type arguments of type CffuModifier and TypeMethodDescriptionstatic <T> Cffu<T>[]CffuFactory.cffuListToArray(List<Cffu<T>> cffuList) Convert Cffu list to Cffu array.