Package io.deephaven.util
Interface CompletionStageFuture<T>
- Type Parameters:
T- The result type returned by this future'sFuture.get()
- All Superinterfaces:
CompletionStage<T>,Future<T>
- All Known Implementing Classes:
CompletionStageFutureImpl
A safe version of CompletableFuture that does not expose the completion API.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Method Summary
Modifier and TypeMethodDescriptionacceptEither(CompletionStage<? extends T> other, Consumer<? super T> action) acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) <U> CompletionStageFuture<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) <U> CompletionStageFuture<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn) <U> CompletionStageFuture<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) static <U> CompletionStageFuture<U> completedFuture(U value) Returns a new CompletionStageFuture that is already completed with the given value.exceptionally(Function<Throwable, ? extends T> fn) static <U> CompletionStageFuture<U> Returns a new CompletionStageFuture that is already completed exceptionally with the given exception.<U> CompletionStageFuture<U> handle(BiFunction<? super T, Throwable, ? extends U> fn) <U> CompletionStageFuture<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn) <U> CompletionStageFuture<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) static <T> CompletionStageFuture.Resolver<T> make()Create a new incomplete future.runAfterBoth(CompletionStage<?> other, Runnable action) runAfterBothAsync(CompletionStage<?> other, Runnable action) runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) runAfterEither(CompletionStage<?> other, Runnable action) runAfterEitherAsync(CompletionStage<?> other, Runnable action) runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) thenAccept(Consumer<? super T> action) thenAcceptAsync(Consumer<? super T> action) thenAcceptAsync(Consumer<? super T> action, Executor executor) thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) <U> CompletionStageFuture<U> <U> CompletionStageFuture<U> thenApplyAsync(Function<? super T, ? extends U> fn) <U> CompletionStageFuture<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor) <U,V> CompletionStageFuture <V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) <U,V> CompletionStageFuture <V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) <U,V> CompletionStageFuture <V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) <U> CompletionStageFuture<U> thenCompose(Function<? super T, ? extends CompletionStage<U>> fn) <U> CompletionStageFuture<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn) <U> CompletionStageFuture<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor) thenRunAsync(Runnable action) thenRunAsync(Runnable action, Executor executor) whenComplete(BiConsumer<? super T, ? super Throwable> action) whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action) whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) Methods inherited from interface java.util.concurrent.CompletionStage
exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, toCompletableFutureMethods inherited from interface java.util.concurrent.Future
cancel, exceptionNow, get, get, isCancelled, isDone, resultNow, state
-
Method Details
-
make
Create a new incomplete future.- Type Parameters:
T- The result type returned by this future'sFuture.get()- Returns:
- a resolver for the future
-
completedFuture
Returns a new CompletionStageFuture that is already completed with the given value.- Type Parameters:
U- the type of the value- Parameters:
value- the value- Returns:
- the completed CompletionStageFuture
- See Also:
-
failedFuture
Returns a new CompletionStageFuture that is already completed exceptionally with the given exception.- Type Parameters:
U- the type of the value- Parameters:
ex- the exception- Returns:
- the exceptionally completed CompletionStageFuture
- See Also:
-
thenApply
- Specified by:
thenApplyin interfaceCompletionStage<T>
-
thenApplyAsync
- Specified by:
thenApplyAsyncin interfaceCompletionStage<T>
-
thenApplyAsync
- Specified by:
thenApplyAsyncin interfaceCompletionStage<T>
-
thenAccept
- Specified by:
thenAcceptin interfaceCompletionStage<T>
-
thenAcceptAsync
- Specified by:
thenAcceptAsyncin interfaceCompletionStage<T>
-
thenAcceptAsync
- Specified by:
thenAcceptAsyncin interfaceCompletionStage<T>
-
thenRun
- Specified by:
thenRunin interfaceCompletionStage<T>
-
thenRunAsync
- Specified by:
thenRunAsyncin interfaceCompletionStage<T>
-
thenRunAsync
- Specified by:
thenRunAsyncin interfaceCompletionStage<T>
-
thenCombine
<U,V> CompletionStageFuture<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) - Specified by:
thenCombinein interfaceCompletionStage<T>
-
thenCombineAsync
<U,V> CompletionStageFuture<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn) - Specified by:
thenCombineAsyncin interfaceCompletionStage<T>
-
thenCombineAsync
<U,V> CompletionStageFuture<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn, Executor executor) - Specified by:
thenCombineAsyncin interfaceCompletionStage<T>
-
thenAcceptBoth
<U> CompletionStageFuture<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) - Specified by:
thenAcceptBothin interfaceCompletionStage<T>
-
thenAcceptBothAsync
<U> CompletionStageFuture<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action) - Specified by:
thenAcceptBothAsyncin interfaceCompletionStage<T>
-
thenAcceptBothAsync
<U> CompletionStageFuture<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action, Executor executor) - Specified by:
thenAcceptBothAsyncin interfaceCompletionStage<T>
-
runAfterBoth
- Specified by:
runAfterBothin interfaceCompletionStage<T>
-
runAfterBothAsync
- Specified by:
runAfterBothAsyncin interfaceCompletionStage<T>
-
runAfterBothAsync
CompletionStageFuture<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor) - Specified by:
runAfterBothAsyncin interfaceCompletionStage<T>
-
applyToEither
<U> CompletionStageFuture<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) - Specified by:
applyToEitherin interfaceCompletionStage<T>
-
applyToEitherAsync
<U> CompletionStageFuture<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn) - Specified by:
applyToEitherAsyncin interfaceCompletionStage<T>
-
applyToEitherAsync
<U> CompletionStageFuture<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn, Executor executor) - Specified by:
applyToEitherAsyncin interfaceCompletionStage<T>
-
acceptEither
CompletionStageFuture<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action) - Specified by:
acceptEitherin interfaceCompletionStage<T>
-
acceptEitherAsync
CompletionStageFuture<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action) - Specified by:
acceptEitherAsyncin interfaceCompletionStage<T>
-
acceptEitherAsync
CompletionStageFuture<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) - Specified by:
acceptEitherAsyncin interfaceCompletionStage<T>
-
runAfterEither
- Specified by:
runAfterEitherin interfaceCompletionStage<T>
-
runAfterEitherAsync
- Specified by:
runAfterEitherAsyncin interfaceCompletionStage<T>
-
runAfterEitherAsync
CompletionStageFuture<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor) - Specified by:
runAfterEitherAsyncin interfaceCompletionStage<T>
-
thenCompose
- Specified by:
thenComposein interfaceCompletionStage<T>
-
thenComposeAsync
- Specified by:
thenComposeAsyncin interfaceCompletionStage<T>
-
thenComposeAsync
<U> CompletionStageFuture<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor) - Specified by:
thenComposeAsyncin interfaceCompletionStage<T>
-
handle
- Specified by:
handlein interfaceCompletionStage<T>
-
handleAsync
- Specified by:
handleAsyncin interfaceCompletionStage<T>
-
handleAsync
<U> CompletionStageFuture<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor) - Specified by:
handleAsyncin interfaceCompletionStage<T>
-
whenComplete
- Specified by:
whenCompletein interfaceCompletionStage<T>
-
whenCompleteAsync
- Specified by:
whenCompleteAsyncin interfaceCompletionStage<T>
-
whenCompleteAsync
CompletionStageFuture<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor) - Specified by:
whenCompleteAsyncin interfaceCompletionStage<T>
-
exceptionally
- Specified by:
exceptionallyin interfaceCompletionStage<T>
-