CompletableFuture (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[acceptEither](../../../java/util/concurrent/CompletableFuture.html#acceptEither-java.util.concurrent.CompletionStage-java.util.function.Consumer-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> other,[Consumer](../../../java/util/function/Consumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> action)
Returns a new CompletionStage that, when either this or the other given stage complete normally, is executed with the corresponding result as argument to the supplied action.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[acceptEitherAsync](../../../java/util/concurrent/CompletableFuture.html#acceptEitherAsync-java.util.concurrent.CompletionStage-java.util.function.Consumer-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> other,[Consumer](../../../java/util/function/Consumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> action)
Returns a new CompletionStage that, when either this or the other given stage complete normally, is executed using this stage's default asynchronous execution facility, with the corresponding result as argument to the supplied action.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[acceptEitherAsync](../../../java/util/concurrent/CompletableFuture.html#acceptEitherAsync-java.util.concurrent.CompletionStage-java.util.function.Consumer-java.util.concurrent.Executor-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> other,[Consumer](../../../java/util/function/Consumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> action,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage 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 [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[allOf](../../../java/util/concurrent/CompletableFuture.html#allOf-java.util.concurrent.CompletableFuture...-)([CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<?>... cfs)
Returns a new CompletableFuture that is completed when all of the given CompletableFutures complete.
static [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Object](../../../java/lang/Object.html "class in java.lang")>
[anyOf](../../../java/util/concurrent/CompletableFuture.html#anyOf-java.util.concurrent.CompletableFuture...-)([CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<?>... cfs)
Returns a new CompletableFuture that is completed when any of the given CompletableFutures complete, with the same result.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[applyToEither](../../../java/util/concurrent/CompletableFuture.html#applyToEither-java.util.concurrent.CompletionStage-java.util.function.Function-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> other,[Function](../../../java/util/function/Function.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),U> fn)
Returns a new CompletionStage that, when either this or the other given stage complete normally, is executed with the corresponding result as argument to the supplied function.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[applyToEitherAsync](../../../java/util/concurrent/CompletableFuture.html#applyToEitherAsync-java.util.concurrent.CompletionStage-java.util.function.Function-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> other,[Function](../../../java/util/function/Function.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),U> fn)
Returns a new CompletionStage that, when either this or the other given stage complete normally, is executed using this stage's default asynchronous execution facility, with the corresponding result as argument to the supplied function.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[applyToEitherAsync](../../../java/util/concurrent/CompletableFuture.html#applyToEitherAsync-java.util.concurrent.CompletionStage-java.util.function.Function-java.util.concurrent.Executor-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> other,[Function](../../../java/util/function/Function.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),U> fn,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage 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.
boolean
[cancel](../../../java/util/concurrent/CompletableFuture.html#cancel-boolean-)(boolean mayInterruptIfRunning)
If not already completed, completes this CompletableFuture with a CancellationException.
boolean
[complete](../../../java/util/concurrent/CompletableFuture.html#complete-T-)([T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture") value)
If not already completed, sets the value returned by get() and related methods to the given value.
static <U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[completedFuture](../../../java/util/concurrent/CompletableFuture.html#completedFuture-U-)(U value)
Returns a new CompletableFuture that is already completed with the given value.
boolean
[completeExceptionally](../../../java/util/concurrent/CompletableFuture.html#completeExceptionally-java.lang.Throwable-)([Throwable](../../../java/lang/Throwable.html "class in java.lang") ex)
If not already completed, causes invocations of get() and related methods to throw the given exception.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")>
[exceptionally](../../../java/util/concurrent/CompletableFuture.html#exceptionally-java.util.function.Function-)([Function](../../../java/util/function/Function.html "interface in java.util.function")<[Throwable](../../../java/lang/Throwable.html "class in java.lang"),? extends [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> fn)
Returns a new CompletableFuture that is completed when this CompletableFuture completes, with the result of the given function of the exception triggering this CompletableFuture's completion when it completes exceptionally; otherwise, if this CompletableFuture completes normally, then the returned CompletableFuture also completes normally with the same value.
[T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")
[get](../../../java/util/concurrent/CompletableFuture.html#get--)()
Waits if necessary for this future to complete, and then returns its result.
[T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")
[get](../../../java/util/concurrent/CompletableFuture.html#get-long-java.util.concurrent.TimeUnit-)(long timeout,[TimeUnit](../../../java/util/concurrent/TimeUnit.html "enum in java.util.concurrent") unit)
Waits if necessary for at most the given time for this future to complete, and then returns its result, if available.
[T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")
[getNow](../../../java/util/concurrent/CompletableFuture.html#getNow-T-)([T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture") valueIfAbsent)
Returns the result value (or throws any encountered exception) if completed, else returns the given valueIfAbsent.
int
[getNumberOfDependents](../../../java/util/concurrent/CompletableFuture.html#getNumberOfDependents--)()
Returns the estimated number of CompletableFutures whose completions are awaiting completion of this CompletableFuture.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[handle](../../../java/util/concurrent/CompletableFuture.html#handle-java.util.function.BiFunction-)([BiFunction](../../../java/util/function/BiFunction.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),[Throwable](../../../java/lang/Throwable.html "class in java.lang"),? extends U> fn)
Returns a new CompletionStage 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> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[handleAsync](../../../java/util/concurrent/CompletableFuture.html#handleAsync-java.util.function.BiFunction-)([BiFunction](../../../java/util/function/BiFunction.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),[Throwable](../../../java/lang/Throwable.html "class in java.lang"),? extends U> fn)
Returns a new CompletionStage that, when this stage completes either normally or exceptionally, is executed using this stage's default asynchronous execution facility, with this stage's result and exception as arguments to the supplied function.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[handleAsync](../../../java/util/concurrent/CompletableFuture.html#handleAsync-java.util.function.BiFunction-java.util.concurrent.Executor-)([BiFunction](../../../java/util/function/BiFunction.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),[Throwable](../../../java/lang/Throwable.html "class in java.lang"),? extends U> fn,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage 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.
boolean
[isCancelled](../../../java/util/concurrent/CompletableFuture.html#isCancelled--)()
Returns true
if this CompletableFuture was cancelled before it completed normally.
boolean
[isCompletedExceptionally](../../../java/util/concurrent/CompletableFuture.html#isCompletedExceptionally--)()
Returns true
if this CompletableFuture completed exceptionally, in any way.
boolean
[isDone](../../../java/util/concurrent/CompletableFuture.html#isDone--)()
Returns true
if completed in any fashion: normally, exceptionally, or via cancellation.
[T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")
[join](../../../java/util/concurrent/CompletableFuture.html#join--)()
Returns the result value when complete, or throws an (unchecked) exception if completed exceptionally.
void
[obtrudeException](../../../java/util/concurrent/CompletableFuture.html#obtrudeException-java.lang.Throwable-)([Throwable](../../../java/lang/Throwable.html "class in java.lang") ex)
Forcibly causes subsequent invocations of method get() and related methods to throw the given exception, whether or not already completed.
void
[obtrudeValue](../../../java/util/concurrent/CompletableFuture.html#obtrudeValue-T-)([T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture") value)
Forcibly sets or resets the value subsequently returned by method get() and related methods, whether or not already completed.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[runAfterBoth](../../../java/util/concurrent/CompletableFuture.html#runAfterBoth-java.util.concurrent.CompletionStage-java.lang.Runnable-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<?> other,[Runnable](../../../java/lang/Runnable.html "interface in java.lang") action)
Returns a new CompletionStage that, when this and the other given stage both complete normally, executes the given action.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[runAfterBothAsync](../../../java/util/concurrent/CompletableFuture.html#runAfterBothAsync-java.util.concurrent.CompletionStage-java.lang.Runnable-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<?> other,[Runnable](../../../java/lang/Runnable.html "interface in java.lang") action)
Returns a new CompletionStage that, when this and the other given stage complete normally, executes the given action using this stage's default asynchronous execution facility.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[runAfterBothAsync](../../../java/util/concurrent/CompletableFuture.html#runAfterBothAsync-java.util.concurrent.CompletionStage-java.lang.Runnable-java.util.concurrent.Executor-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<?> other,[Runnable](../../../java/lang/Runnable.html "interface in java.lang") action,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage that, when this and the other given stage complete normally, executes the given action using the supplied executor.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[runAfterEither](../../../java/util/concurrent/CompletableFuture.html#runAfterEither-java.util.concurrent.CompletionStage-java.lang.Runnable-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<?> other,[Runnable](../../../java/lang/Runnable.html "interface in java.lang") action)
Returns a new CompletionStage that, when either this or the other given stage complete normally, executes the given action.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[runAfterEitherAsync](../../../java/util/concurrent/CompletableFuture.html#runAfterEitherAsync-java.util.concurrent.CompletionStage-java.lang.Runnable-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<?> other,[Runnable](../../../java/lang/Runnable.html "interface in java.lang") action)
Returns a new CompletionStage that, when either this or the other given stage complete normally, executes the given action using this stage's default asynchronous execution facility.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[runAfterEitherAsync](../../../java/util/concurrent/CompletableFuture.html#runAfterEitherAsync-java.util.concurrent.CompletionStage-java.lang.Runnable-java.util.concurrent.Executor-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<?> other,[Runnable](../../../java/lang/Runnable.html "interface in java.lang") action,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage that, when either this or the other given stage complete normally, executes the given action using the supplied executor.
static [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[runAsync](../../../java/util/concurrent/CompletableFuture.html#runAsync-java.lang.Runnable-)([Runnable](../../../java/lang/Runnable.html "interface in java.lang") runnable)
Returns a new CompletableFuture that is asynchronously completed by a task running in the ForkJoinPool.commonPool() after it runs the given action.
static [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[runAsync](../../../java/util/concurrent/CompletableFuture.html#runAsync-java.lang.Runnable-java.util.concurrent.Executor-)([Runnable](../../../java/lang/Runnable.html "interface in java.lang") runnable,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor after it runs the given action.
static <U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[supplyAsync](../../../java/util/concurrent/CompletableFuture.html#supplyAsync-java.util.function.Supplier-)([Supplier](../../../java/util/function/Supplier.html "interface in java.util.function")<U> supplier)
Returns a new CompletableFuture that is asynchronously completed by a task running in the ForkJoinPool.commonPool() with the value obtained by calling the given Supplier.
static <U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[supplyAsync](../../../java/util/concurrent/CompletableFuture.html#supplyAsync-java.util.function.Supplier-java.util.concurrent.Executor-)([Supplier](../../../java/util/function/Supplier.html "interface in java.util.function")<U> supplier,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[thenAccept](../../../java/util/concurrent/CompletableFuture.html#thenAccept-java.util.function.Consumer-)([Consumer](../../../java/util/function/Consumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> action)
Returns a new CompletionStage that, when this stage completes normally, is executed with this stage's result as the argument to the supplied action.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[thenAcceptAsync](../../../java/util/concurrent/CompletableFuture.html#thenAcceptAsync-java.util.function.Consumer-)([Consumer](../../../java/util/function/Consumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> action)
Returns a new CompletionStage that, when this stage completes normally, is executed using this stage's default asynchronous execution facility, with this stage's result as the argument to the supplied action.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[thenAcceptAsync](../../../java/util/concurrent/CompletableFuture.html#thenAcceptAsync-java.util.function.Consumer-java.util.concurrent.Executor-)([Consumer](../../../java/util/function/Consumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")> action,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage that, when this stage completes normally, is executed using the supplied Executor, with this stage's result as the argument to the supplied action.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[thenAcceptBoth](../../../java/util/concurrent/CompletableFuture.html#thenAcceptBoth-java.util.concurrent.CompletionStage-java.util.function.BiConsumer-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends U> other,[BiConsumer](../../../java/util/function/BiConsumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? super U> action)
Returns a new CompletionStage that, when this and the other given stage both complete normally, is executed with the two results as arguments to the supplied action.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[thenAcceptBothAsync](../../../java/util/concurrent/CompletableFuture.html#thenAcceptBothAsync-java.util.concurrent.CompletionStage-java.util.function.BiConsumer-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends U> other,[BiConsumer](../../../java/util/function/BiConsumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? super U> action)
Returns a new CompletionStage that, when this and the other given stage complete normally, is executed using this stage's default asynchronous execution facility, with the two results as arguments to the supplied action.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[thenAcceptBothAsync](../../../java/util/concurrent/CompletableFuture.html#thenAcceptBothAsync-java.util.concurrent.CompletionStage-java.util.function.BiConsumer-java.util.concurrent.Executor-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends U> other,[BiConsumer](../../../java/util/function/BiConsumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? super U> action,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage that, when this and the other given stage complete normally, is executed using the supplied executor, with the two results as arguments to the supplied function.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[thenApply](../../../java/util/concurrent/CompletableFuture.html#thenApply-java.util.function.Function-)([Function](../../../java/util/function/Function.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? extends U> fn)
Returns a new CompletionStage that, when this stage completes normally, is executed with this stage's result as the argument to the supplied function.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[thenApplyAsync](../../../java/util/concurrent/CompletableFuture.html#thenApplyAsync-java.util.function.Function-)([Function](../../../java/util/function/Function.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? extends U> fn)
Returns a new CompletionStage that, when this stage completes normally, is executed using this stage's default asynchronous execution facility, with this stage's result as the argument to the supplied function.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[thenApplyAsync](../../../java/util/concurrent/CompletableFuture.html#thenApplyAsync-java.util.function.Function-java.util.concurrent.Executor-)([Function](../../../java/util/function/Function.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? extends U> fn,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage 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> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<V>
[thenCombine](../../../java/util/concurrent/CompletableFuture.html#thenCombine-java.util.concurrent.CompletionStage-java.util.function.BiFunction-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends U> other,[BiFunction](../../../java/util/function/BiFunction.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? super U,? extends V> fn)
Returns a new CompletionStage 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> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<V>
[thenCombineAsync](../../../java/util/concurrent/CompletableFuture.html#thenCombineAsync-java.util.concurrent.CompletionStage-java.util.function.BiFunction-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends U> other,[BiFunction](../../../java/util/function/BiFunction.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? super U,? extends V> fn)
Returns a new CompletionStage that, when this and the other given stage complete normally, is executed using this stage's default asynchronous execution facility, with the two results as arguments to the supplied function.
<U,V> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<V>
[thenCombineAsync](../../../java/util/concurrent/CompletableFuture.html#thenCombineAsync-java.util.concurrent.CompletionStage-java.util.function.BiFunction-java.util.concurrent.Executor-)([CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<? extends U> other,[BiFunction](../../../java/util/function/BiFunction.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? super U,? extends V> fn,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage that, when this and the other given stage complete normally, is executed using the supplied executor, with the two results as arguments to the supplied function.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[thenCompose](../../../java/util/concurrent/CompletableFuture.html#thenCompose-java.util.function.Function-)([Function](../../../java/util/function/Function.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? extends [CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<U>> fn)
Returns a new CompletionStage that, when this stage completes normally, is executed with this stage as the argument to the supplied function.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[thenComposeAsync](../../../java/util/concurrent/CompletableFuture.html#thenComposeAsync-java.util.function.Function-)([Function](../../../java/util/function/Function.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? extends [CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<U>> fn)
Returns a new CompletionStage that, when this stage completes normally, is executed using this stage's default asynchronous execution facility, with this stage as the argument to the supplied function.
<U> [CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<U>
[thenComposeAsync](../../../java/util/concurrent/CompletableFuture.html#thenComposeAsync-java.util.function.Function-java.util.concurrent.Executor-)([Function](../../../java/util/function/Function.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? extends [CompletionStage](../../../java/util/concurrent/CompletionStage.html "interface in java.util.concurrent")<U>> fn,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage that, when this stage completes normally, is executed using the supplied Executor, with this stage's result as the argument to the supplied function.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[thenRun](../../../java/util/concurrent/CompletableFuture.html#thenRun-java.lang.Runnable-)([Runnable](../../../java/lang/Runnable.html "interface in java.lang") action)
Returns a new CompletionStage that, when this stage completes normally, executes the given action.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[thenRunAsync](../../../java/util/concurrent/CompletableFuture.html#thenRunAsync-java.lang.Runnable-)([Runnable](../../../java/lang/Runnable.html "interface in java.lang") action)
Returns a new CompletionStage that, when this stage completes normally, executes the given action using this stage's default asynchronous execution facility.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[Void](../../../java/lang/Void.html "class in java.lang")>
[thenRunAsync](../../../java/util/concurrent/CompletableFuture.html#thenRunAsync-java.lang.Runnable-java.util.concurrent.Executor-)([Runnable](../../../java/lang/Runnable.html "interface in java.lang") action,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage that, when this stage completes normally, executes the given action using the supplied Executor.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")>
[toCompletableFuture](../../../java/util/concurrent/CompletableFuture.html#toCompletableFuture--)()
Returns this CompletableFuture.
[String](../../../java/lang/String.html "class in java.lang")
[toString](../../../java/util/concurrent/CompletableFuture.html#toString--)()
Returns a string identifying this CompletableFuture, as well as its completion state.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")>
[whenComplete](../../../java/util/concurrent/CompletableFuture.html#whenComplete-java.util.function.BiConsumer-)([BiConsumer](../../../java/util/function/BiConsumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? super [Throwable](../../../java/lang/Throwable.html "class in java.lang")> action)
Returns a new CompletionStage with the same result or exception as this stage, that executes the given action when this stage completes.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")>
[whenCompleteAsync](../../../java/util/concurrent/CompletableFuture.html#whenCompleteAsync-java.util.function.BiConsumer-)([BiConsumer](../../../java/util/function/BiConsumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? super [Throwable](../../../java/lang/Throwable.html "class in java.lang")> action)
Returns a new CompletionStage with the same result or exception as this stage, that executes the given action using this stage's default asynchronous execution facility when this stage completes.
[CompletableFuture](../../../java/util/concurrent/CompletableFuture.html "class in java.util.concurrent")<[T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture")>
[whenCompleteAsync](../../../java/util/concurrent/CompletableFuture.html#whenCompleteAsync-java.util.function.BiConsumer-java.util.concurrent.Executor-)([BiConsumer](../../../java/util/function/BiConsumer.html "interface in java.util.function")<? super [T](../../../java/util/concurrent/CompletableFuture.html "type parameter in CompletableFuture"),? super [Throwable](../../../java/lang/Throwable.html "class in java.lang")> action,[Executor](../../../java/util/concurrent/Executor.html "interface in java.util.concurrent") executor)
Returns a new CompletionStage with the same result or exception as this stage, that executes the given action using the supplied Executor when this stage completes.