T - a type of the successfully resolved promise valuepublic abstract class PromiseAdapter<T> extends Object implements Promise<T>
Promise subclass as an
implementation from scratch.
All calls are delegated to the asynchronus methods (*Async) with
explicit Executor parameter.
| Modifier and Type | Field and Description |
|---|---|
protected static Executor |
SAME_THREAD_EXECUTOR |
| Modifier | Constructor and Description |
|---|---|
protected |
PromiseAdapter(Executor defaultExecutor) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitacceptEitherAsync, applyToEitherAsync, as, defaultAsyncOn, delay, delay, delay, delay, dependent, dependent, exceptionallyAsync, exceptionallyComposeAsync, getNow, getNow, handleAsync, isCompletedExceptionally, join, onCancel, onTimeout, onTimeout, onTimeout, onTimeout, onTimeout, onTimeout, onTimeout, onTimeout, orTimeout, orTimeout, orTimeout, orTimeout, raw, runAfterBothAsync, runAfterEitherAsync, thenAcceptAsync, thenAcceptBothAsync, thenApplyAsync, thenCombineAsync, thenComposeAsync, thenFilterAsync, thenFilterAsync, thenRunAsync, unwrap, whenCompleteAsynctoCompletableFutureprotected static final Executor SAME_THREAD_EXECUTOR
protected PromiseAdapter(Executor defaultExecutor)
public <U> Promise<U> thenApplyAsync(Function<? super T,? extends U> fn)
thenApplyAsync in interface CompletionStage<T>thenApplyAsync in interface Promise<T>public Promise<Void> thenAccept(Consumer<? super T> action)
thenAccept in interface CompletionStage<T>thenAccept in interface Promise<T>public Promise<Void> thenAcceptAsync(Consumer<? super T> action)
thenAcceptAsync in interface CompletionStage<T>thenAcceptAsync in interface Promise<T>public Promise<Void> thenRunAsync(Runnable action)
thenRunAsync in interface CompletionStage<T>thenRunAsync in interface Promise<T>public <U,V> Promise<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn)
thenCombine in interface CompletionStage<T>thenCombine in interface Promise<T>public <U,V> Promise<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn)
thenCombineAsync in interface CompletionStage<T>thenCombineAsync in interface Promise<T>public <U> Promise<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action)
thenAcceptBoth in interface CompletionStage<T>thenAcceptBoth in interface Promise<T>public <U> Promise<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action)
thenAcceptBothAsync in interface CompletionStage<T>thenAcceptBothAsync in interface Promise<T>public Promise<Void> runAfterBoth(CompletionStage<?> other, Runnable action)
runAfterBoth in interface CompletionStage<T>runAfterBoth in interface Promise<T>public Promise<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action)
runAfterBothAsync in interface CompletionStage<T>runAfterBothAsync in interface Promise<T>public <U> Promise<U> applyToEither(CompletionStage<? extends T> other, Function<? super T,U> fn)
applyToEither in interface CompletionStage<T>applyToEither in interface Promise<T>public <U> Promise<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T,U> fn)
applyToEitherAsync in interface CompletionStage<T>applyToEitherAsync in interface Promise<T>public Promise<T> exceptionally(Function<Throwable,? extends T> fn)
exceptionally in interface CompletionStage<T>exceptionally in interface Promise<T>public Promise<T> exceptionallyAsync(Function<Throwable,? extends T> fn)
exceptionallyAsync in interface Promise<T>public Promise<T> exceptionallyCompose(Function<Throwable,? extends CompletionStage<T>> fn)
exceptionallyCompose in interface Promise<T>public Promise<T> exceptionallyComposeAsync(Function<Throwable,? extends CompletionStage<T>> fn)
exceptionallyComposeAsync in interface Promise<T>public Promise<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action)
acceptEither in interface CompletionStage<T>acceptEither in interface Promise<T>public Promise<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action)
acceptEitherAsync in interface CompletionStage<T>acceptEitherAsync in interface Promise<T>public Promise<Void> runAfterEither(CompletionStage<?> other, Runnable action)
runAfterEither in interface CompletionStage<T>runAfterEither in interface Promise<T>public Promise<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action)
runAfterEitherAsync in interface CompletionStage<T>runAfterEitherAsync in interface Promise<T>public <U> Promise<U> thenCompose(Function<? super T,? extends CompletionStage<U>> fn)
thenCompose in interface CompletionStage<T>thenCompose in interface Promise<T>public <U> Promise<U> thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn)
thenComposeAsync in interface CompletionStage<T>thenComposeAsync in interface Promise<T>public Promise<T> thenFilter(Predicate<? super T> predicate)
thenFilter in interface Promise<T>public Promise<T> thenFilter(Predicate<? super T> predicate, Function<? super T,Throwable> errorSupplier)
thenFilter in interface Promise<T>public Promise<T> thenFilterAsync(Predicate<? super T> predicate)
thenFilterAsync in interface Promise<T>public Promise<T> thenFilterAsync(Predicate<? super T> predicate, Function<? super T,Throwable> errorSupplier)
thenFilterAsync in interface Promise<T>public Promise<T> whenComplete(BiConsumer<? super T,? super Throwable> action)
whenComplete in interface CompletionStage<T>whenComplete in interface Promise<T>public Promise<T> whenCompleteAsync(BiConsumer<? super T,? super Throwable> action)
whenCompleteAsync in interface CompletionStage<T>whenCompleteAsync in interface Promise<T>public <U> Promise<U> handle(BiFunction<? super T,Throwable,? extends U> fn)
public <U> Promise<U> handleAsync(BiFunction<? super T,Throwable,? extends U> fn)
handleAsync in interface CompletionStage<T>handleAsync in interface Promise<T>protected final Executor getDefaultExecutor()
Copyright © 2021. All rights reserved.