Uses of Class
io.foldright.cffu.Cffu
Packages that use Cffu
Package
Description
A tiny 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.Cffu.acceptEitherSuccess(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.acceptEitherSuccessAsync(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.acceptEitherSuccessAsync(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(CompletionStage<?>... cfs) Returns a new Cffu that is completed when all the given stages complete.CffuFactory.allOfFastFail(CompletionStage<?>... cfs) Returns a new Cffu that is successful when all the given stages success, the results(Cffu<Void>) of the given stages are not reflected in the returned Cffu, but may be obtained by inspecting them individually.CffuFactory.allResultsOf(CompletionStage<? extends T>... cfs) Returns a new Cffu with the results in the same order of all the given stages, the new Cffu is completed when all the given stages complete.CffuFactory.allResultsOfFastFail(CompletionStage<? extends T>... cfs) Returns a new Cffu with the results in the same order of all the given stages, the new Cffu success when all the given stages success.Cffu.allTupleOf(CompletionStage<? extends T2> cf2) This method is the same asCffuFactory.allTupleOf(CompletionStage, CompletionStage), providing this method is convenient for method chaining.Cffu.allTupleOf(CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) This method is the same asCffuFactory.allTupleOf(CompletionStage, CompletionStage, CompletionStage), providing this method is convenient for method chaining.Cffu.allTupleOf(CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) This method is the same asCffuFactory.allTupleOf(CompletionStage, CompletionStage, CompletionStage, CompletionStage), providing this method is convenient for method chaining.Cffu.allTupleOf(CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5) This method is the same asCffuFactory.allTupleOf(CompletionStage, CompletionStage, CompletionStage, CompletionStage, CompletionStage), providing this method is convenient for method chaining.CffuFactory.allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) Returns a new Cffu that is completed when the given two CompletableFutures complete.CffuFactory.allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) Returns a new Cffu that is completed when the given three CompletableFutures complete.CffuFactory.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 4 CompletableFutures complete.CffuFactory.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 5 CompletableFutures complete.Cffu.allTupleOfFastFail(CompletionStage<? extends T2> cf2) This method is the same asCffuFactory.allTupleOfFastFail(CompletionStage, CompletionStage), providing this method is convenient for method chaining.Cffu.allTupleOfFastFail(CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) This method is the same asCffuFactory.allTupleOfFastFail(CompletionStage, CompletionStage, CompletionStage), providing this method is convenient for method chaining.Cffu.allTupleOfFastFail(CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) This method is the same asCffuFactory.allTupleOfFastFail(CompletionStage, CompletionStage, CompletionStage, CompletionStage), providing this method is convenient for method chaining.Cffu.allTupleOfFastFail(CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5) This method is the same asCffuFactory.allTupleOfFastFail(CompletionStage, CompletionStage, CompletionStage, CompletionStage, CompletionStage), providing this method is convenient for method chaining.CffuFactory.allTupleOfFastFail(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) Returns a new Cffu that is successful when the given two CompletableFutures success.CffuFactory.allTupleOfFastFail(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) Returns a new Cffu that is successful when the given three CompletableFutures success.CffuFactory.allTupleOfFastFail(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 CompletableFutures success.CffuFactory.allTupleOfFastFail(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 CompletableFutures success.final <T> Cffu<T> CffuFactory.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> CffuFactory.anyOfSuccess(CompletionStage<? extends T>... cfs) Returns a new Cffu that is successful when any of the given stages 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.<U> Cffu<U> Cffu.applyToEitherSuccess(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.applyToEitherSuccessAsync(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.applyToEitherSuccessAsync(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.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 cffu completes either normally or exceptionally, is executed with this cffu'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 cffu completes either normally or exceptionally, is executed usingdefaultExecutor(), with this cffu'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 cffu completes either normally or exceptionally, is executed using the supplied executor, with this cffu'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.peek(BiConsumer<? super T, ? super Throwable> action) Peeks the result by executing the given action when this cffu completes, returns this cffu.Cffu.peekAsync(BiConsumer<? super T, ? super Throwable> action) Peeks the result by executing the given action when this cffu completes, executes the given action usingdefaultExecutor(), returns this cffu.Cffu.peekAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) Peeks the result by executing the given action when this cffu completes, that executes the given action using the supplied Executor when this cffu completes, returns this cffu.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.runAfterBothFastFail(CompletionStage<?> other, Runnable action) Returns a new Cffu that, when this and the other given stage both complete normally, executes the given action.Cffu.runAfterBothFastFailAsync(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.runAfterBothFastFailAsync(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.Cffu.runAfterEitherSuccess(CompletionStage<?> other, Runnable action) Returns a new Cffu that, when either this or the other given stage complete normally, executes the given action.Cffu.runAfterEitherSuccessAsync(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.runAfterEitherSuccessAsync(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.Cffu.thenAcceptBothFastFail(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.thenAcceptBothFastFailAsync(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.thenAcceptBothFastFailAsync(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,V> Cffu <V> Cffu.thenCombineFastFail(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.thenCombineFastFailAsync(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.thenCombineFastFailAsync(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.<T> Cffu<T> CffuFactory.toCffu(CompletionStage<T> stage) final <T> Cffu<T>[]CffuFactory.toCffuArray(CompletionStage<T>... stages) A convenient util method for wrap inputCompletableFuture/CompletionStage/Cffuarray element byCffuFactory.toCffu(CompletionStage).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 TypeMethodDescriptionstatic <T> CompletableFuture<T>[]CffuFactory.cffuArrayUnwrap(Cffu<T>... cfs) A convenient util method for unwrap inputCffuarray elements bycffuUnwrap().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.