| 程序包 | 说明 |
|---|---|
| com.jn.langx.util.concurrent.completion |
| 限定符和类型 | 类和说明 |
|---|---|
class |
CompletableFuture<T>
A { Future} that may be explicitly completed (setting its
value and status), and may be used as a { CompletionStep},
supporting dependent functions and actions that trigger upon its
completion.
|
| 限定符和类型 | 方法和说明 |
|---|---|
CompletionStep<Void> |
CompletionStep.acceptEither(CompletionStep<? extends T> other,
Consumer<? super T> 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.
|
CompletionStep<Void> |
CompletionStep.acceptEitherAsync(CompletionStep<? extends T> other,
Consumer<? super T> 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.
|
CompletionStep<Void> |
CompletionStep.acceptEitherAsync(CompletionStep<? extends T> other,
Consumer<? super T> action,
Executor 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 action.
|
<U> CompletionStep<U> |
CompletionStep.applyToEither(CompletionStep<? extends T> other,
Function<? super T,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> CompletionStep<U> |
CompletionStep.applyToEitherAsync(CompletionStep<? extends T> other,
Function<? super T,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> CompletionStep<U> |
CompletionStep.applyToEitherAsync(CompletionStep<? extends T> other,
Function<? super T,U> fn,
Executor 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.
|
CompletionStep<T> |
CompletionStep.exceptionally(Function<Throwable,? extends T> fn)
Returns a new CompletionStage that, when this stage completes
exceptionally, is executed with this stage's exception as the
argument to the supplied function.
|
<U> CompletionStep<U> |
CompletionStep.handle(Function2<? super T,Throwable,? 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> CompletionStep<U> |
CompletionStep.handleAsync(Function2<? super T,Throwable,? 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> CompletionStep<U> |
CompletionStep.handleAsync(Function2<? super T,Throwable,? extends U> fn,
Executor 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.
|
CompletionStep<Void> |
CompletionStep.runAfterBoth(CompletionStep<?> other,
Runnable action)
Returns a new CompletionStage that, when this and the other
given stage both complete normally, executes the given action.
|
CompletionStep<Void> |
CompletionStep.runAfterBothAsync(CompletionStep<?> other,
Runnable action)
Returns a new CompletionStage that, when this and the other
given stage both complete normally, executes the given action
using this stage's default asynchronous execution facility.
|
CompletionStep<Void> |
CompletionStep.runAfterBothAsync(CompletionStep<?> other,
Runnable action,
Executor executor)
Returns a new CompletionStage that, when this and the other
given stage both complete normally, executes the given action
using the supplied executor.
|
CompletionStep<Void> |
CompletionStep.runAfterEither(CompletionStep<?> other,
Runnable action)
Returns a new CompletionStage that, when either this or the
other given stage complete normally, executes the given action.
|
CompletionStep<Void> |
CompletionStep.runAfterEitherAsync(CompletionStep<?> other,
Runnable 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.
|
CompletionStep<Void> |
CompletionStep.runAfterEitherAsync(CompletionStep<?> other,
Runnable action,
Executor executor)
Returns a new CompletionStage that, when either this or the
other given stage complete normally, executes the given action
using the supplied executor.
|
CompletionStep<Void> |
CompletionStep.thenAccept(Consumer<? super T> 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.
|
CompletionStep<Void> |
CompletionStep.thenAcceptAsync(Consumer<? super T> 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.
|
CompletionStep<Void> |
CompletionStep.thenAcceptAsync(Consumer<? super T> action,
Executor 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> CompletionStep<Void> |
CompletionStep.thenAcceptBoth(CompletionStep<? extends U> other,
Consumer2<? super T,? 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> CompletionStep<Void> |
CompletionStep.thenAcceptBothAsync(CompletionStep<? extends U> other,
Consumer2<? super T,? super U> action)
Returns a new CompletionStage that, when this and the other
given stage both complete normally, is executed using this
stage's default asynchronous execution facility, with the two
results as arguments to the supplied action.
|
<U> CompletionStep<Void> |
CompletionStep.thenAcceptBothAsync(CompletionStep<? extends U> other,
Consumer2<? super T,? super U> action,
Executor executor)
Returns a new CompletionStage 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> CompletionStep<U> |
CompletionStep.thenApply(Function<? super T,? 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> CompletionStep<U> |
CompletionStep.thenApplyAsync(Function<? super T,? 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> CompletionStep<U> |
CompletionStep.thenApplyAsync(Function<? super T,? extends U> fn,
Executor 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> CompletionStep<V> |
CompletionStep.thenCombine(CompletionStep<? extends U> other,
Function2<? super T,? 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> CompletionStep<V> |
CompletionStep.thenCombineAsync(CompletionStep<? extends U> other,
Function2<? super T,? super U,? extends V> fn)
Returns a new CompletionStage that, when this and the other
given stage both complete normally, is executed using this
stage's default asynchronous execution facility, with the two
results as arguments to the supplied function.
|
<U,V> CompletionStep<V> |
CompletionStep.thenCombineAsync(CompletionStep<? extends U> other,
Function2<? super T,? super U,? extends V> fn,
Executor executor)
Returns a new CompletionStage 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> CompletionStep<U> |
CompletionStep.thenCompose(Function<? super T,? extends CompletionStep<U>> fn)
Returns a new CompletionStage that is completed with the same
value as the CompletionStage returned by the given function.
|
<U> CompletionStep<U> |
CompletionStep.thenComposeAsync(Function<? super T,? extends CompletionStep<U>> fn)
Returns a new CompletionStage that is completed with the same
value as the CompletionStage returned by the given function,
executed using this stage's default asynchronous execution
facility.
|
<U> CompletionStep<U> |
CompletionStep.thenComposeAsync(Function<? super T,? extends CompletionStep<U>> fn,
Executor executor)
Returns a new CompletionStage that is completed with the same
value as the CompletionStage returned by the given function,
executed using the supplied Executor.
|
CompletionStep<Void> |
CompletionStep.thenRun(Runnable action)
Returns a new CompletionStage that, when this stage completes
normally, executes the given action.
|
CompletionStep<Void> |
CompletionStep.thenRunAsync(Runnable action)
Returns a new CompletionStage that, when this stage completes
normally, executes the given action using this stage's default
asynchronous execution facility.
|
CompletionStep<Void> |
CompletionStep.thenRunAsync(Runnable action,
Executor executor)
Returns a new CompletionStage that, when this stage completes
normally, executes the given action using the supplied Executor.
|
CompletionStep<T> |
CompletionStep.whenComplete(Consumer2<? super T,? super Throwable> action)
Returns a new CompletionStage with the same result or exception as
this stage, that executes the given action when this stage completes.
|
CompletionStep<T> |
CompletionStep.whenCompleteAsync(Consumer2<? super T,? super Throwable> 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.
|
CompletionStep<T> |
CompletionStep.whenCompleteAsync(Consumer2<? super T,? super Throwable> action,
Executor 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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
CompletionStep<Void> |
CompletionStep.acceptEither(CompletionStep<? extends T> other,
Consumer<? super T> 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<Void> |
CompletableFuture.acceptEither(CompletionStep<? extends T> other,
Consumer<? super T> action) |
CompletionStep<Void> |
CompletionStep.acceptEitherAsync(CompletionStep<? extends T> other,
Consumer<? super T> 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<Void> |
CompletableFuture.acceptEitherAsync(CompletionStep<? extends T> other,
Consumer<? super T> action) |
CompletionStep<Void> |
CompletionStep.acceptEitherAsync(CompletionStep<? extends T> other,
Consumer<? super T> action,
Executor 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 action.
|
CompletableFuture<Void> |
CompletableFuture.acceptEitherAsync(CompletionStep<? extends T> other,
Consumer<? super T> action,
Executor executor) |
<U> CompletionStep<U> |
CompletionStep.applyToEither(CompletionStep<? extends T> other,
Function<? super T,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<U> |
CompletableFuture.applyToEither(CompletionStep<? extends T> other,
Function<? super T,U> fn) |
<U> CompletionStep<U> |
CompletionStep.applyToEitherAsync(CompletionStep<? extends T> other,
Function<? super T,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<U> |
CompletableFuture.applyToEitherAsync(CompletionStep<? extends T> other,
Function<? super T,U> fn) |
<U> CompletionStep<U> |
CompletionStep.applyToEitherAsync(CompletionStep<? extends T> other,
Function<? super T,U> fn,
Executor 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.
|
<U> CompletableFuture<U> |
CompletableFuture.applyToEitherAsync(CompletionStep<? extends T> other,
Function<? super T,U> fn,
Executor executor) |
CompletionStep<Void> |
CompletionStep.runAfterBoth(CompletionStep<?> other,
Runnable action)
Returns a new CompletionStage that, when this and the other
given stage both complete normally, executes the given action.
|
CompletableFuture<Void> |
CompletableFuture.runAfterBoth(CompletionStep<?> other,
Runnable action) |
CompletionStep<Void> |
CompletionStep.runAfterBothAsync(CompletionStep<?> other,
Runnable action)
Returns a new CompletionStage that, when this and the other
given stage both complete normally, executes the given action
using this stage's default asynchronous execution facility.
|
CompletableFuture<Void> |
CompletableFuture.runAfterBothAsync(CompletionStep<?> other,
Runnable action) |
CompletionStep<Void> |
CompletionStep.runAfterBothAsync(CompletionStep<?> other,
Runnable action,
Executor executor)
Returns a new CompletionStage that, when this and the other
given stage both complete normally, executes the given action
using the supplied executor.
|
CompletableFuture<Void> |
CompletableFuture.runAfterBothAsync(CompletionStep<?> other,
Runnable action,
Executor executor) |
CompletionStep<Void> |
CompletionStep.runAfterEither(CompletionStep<?> other,
Runnable action)
Returns a new CompletionStage that, when either this or the
other given stage complete normally, executes the given action.
|
CompletableFuture<Void> |
CompletableFuture.runAfterEither(CompletionStep<?> other,
Runnable action) |
CompletionStep<Void> |
CompletionStep.runAfterEitherAsync(CompletionStep<?> other,
Runnable 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<Void> |
CompletableFuture.runAfterEitherAsync(CompletionStep<?> other,
Runnable action) |
CompletionStep<Void> |
CompletionStep.runAfterEitherAsync(CompletionStep<?> other,
Runnable action,
Executor executor)
Returns a new CompletionStage that, when either this or the
other given stage complete normally, executes the given action
using the supplied executor.
|
CompletableFuture<Void> |
CompletableFuture.runAfterEitherAsync(CompletionStep<?> other,
Runnable action,
Executor executor) |
<U> CompletionStep<Void> |
CompletionStep.thenAcceptBoth(CompletionStep<? extends U> other,
Consumer2<? super T,? 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<Void> |
CompletableFuture.thenAcceptBoth(CompletionStep<? extends U> other,
Consumer2<? super T,? super U> action) |
<U> CompletionStep<Void> |
CompletionStep.thenAcceptBothAsync(CompletionStep<? extends U> other,
Consumer2<? super T,? super U> action)
Returns a new CompletionStage that, when this and the other
given stage both complete normally, is executed using this
stage's default asynchronous execution facility, with the two
results as arguments to the supplied action.
|
<U> CompletableFuture<Void> |
CompletableFuture.thenAcceptBothAsync(CompletionStep<? extends U> other,
Consumer2<? super T,? super U> action) |
<U> CompletionStep<Void> |
CompletionStep.thenAcceptBothAsync(CompletionStep<? extends U> other,
Consumer2<? super T,? super U> action,
Executor executor)
Returns a new CompletionStage 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> CompletableFuture<Void> |
CompletableFuture.thenAcceptBothAsync(CompletionStep<? extends U> other,
Consumer2<? super T,? super U> action,
Executor executor) |
<U,V> CompletionStep<V> |
CompletionStep.thenCombine(CompletionStep<? extends U> other,
Function2<? super T,? 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<V> |
CompletableFuture.thenCombine(CompletionStep<? extends U> other,
Function2<? super T,? super U,? extends V> fn) |
<U,V> CompletionStep<V> |
CompletionStep.thenCombineAsync(CompletionStep<? extends U> other,
Function2<? super T,? super U,? extends V> fn)
Returns a new CompletionStage that, when this and the other
given stage both 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<V> |
CompletableFuture.thenCombineAsync(CompletionStep<? extends U> other,
Function2<? super T,? super U,? extends V> fn) |
<U,V> CompletionStep<V> |
CompletionStep.thenCombineAsync(CompletionStep<? extends U> other,
Function2<? super T,? super U,? extends V> fn,
Executor executor)
Returns a new CompletionStage 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> CompletableFuture<V> |
CompletableFuture.thenCombineAsync(CompletionStep<? extends U> other,
Function2<? super T,? super U,? extends V> fn,
Executor executor) |
| 限定符和类型 | 方法和说明 |
|---|---|
<U> CompletionStep<U> |
CompletionStep.thenCompose(Function<? super T,? extends CompletionStep<U>> fn)
Returns a new CompletionStage that is completed with the same
value as the CompletionStage returned by the given function.
|
<U> CompletableFuture<U> |
CompletableFuture.thenCompose(Function<? super T,? extends CompletionStep<U>> fn) |
<U> CompletionStep<U> |
CompletionStep.thenComposeAsync(Function<? super T,? extends CompletionStep<U>> fn)
Returns a new CompletionStage that is completed with the same
value as the CompletionStage returned by the given function,
executed using this stage's default asynchronous execution
facility.
|
<U> CompletableFuture<U> |
CompletableFuture.thenComposeAsync(Function<? super T,? extends CompletionStep<U>> fn) |
<U> CompletionStep<U> |
CompletionStep.thenComposeAsync(Function<? super T,? extends CompletionStep<U>> fn,
Executor executor)
Returns a new CompletionStage that is completed with the same
value as the CompletionStage returned by the given function,
executed using the supplied Executor.
|
<U> CompletableFuture<U> |
CompletableFuture.thenComposeAsync(Function<? super T,? extends CompletionStep<U>> fn,
Executor executor) |
Copyright © 2020. All rights reserved.