T - a type of the successfully resolved promise valueD - a type of the concrete Promise subclasspublic abstract class AbstractPromiseDecorator<T,D extends Promise<T>> extends AbstractFutureDecorator<T,D> implements Promise<T>
delegate| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPromiseDecorator(D delegate) |
| Modifier and Type | Method and Description |
|---|---|
Promise<T> |
defaultAsyncOn(Executor executor) |
Promise<T> |
delay(Duration duration) |
Promise<T> |
delay(Duration duration,
boolean delayOnError) |
Promise<T> |
delay(long timeout,
TimeUnit unit) |
Promise<T> |
delay(long timeout,
TimeUnit unit,
boolean delayOnError) |
DependentPromise<T> |
dependent()
Converts this
Promise to a DependentPromise
The returned DependentPromise does not implicitly enlist any CompletionStage
for cancellation (neither self, nor passed as arguments to combining methods);
only enlisting via explicit parameter is supported |
DependentPromise<T> |
dependent(Set<PromiseOrigin> defaultEnlistOptions)
Converts this
Promise to a DependentPromise
The returned DependentPromise does implicitly enlist CompletionStage
for cancellation (either self, and/or passed as arguments to combining methods)
according to defaultEnlistOptions parameter |
Promise<T> |
exceptionallyAsync(Function<Throwable,? extends T> fn) |
Promise<T> |
exceptionallyAsync(Function<Throwable,? extends T> fn,
Executor executor) |
Promise<T> |
exceptionallyCompose(Function<Throwable,? extends CompletionStage<T>> fn) |
Promise<T> |
exceptionallyComposeAsync(Function<Throwable,? extends CompletionStage<T>> fn) |
Promise<T> |
exceptionallyComposeAsync(Function<Throwable,? extends CompletionStage<T>> fn,
Executor executor) |
T |
getNow(Supplier<? extends T> valueIfAbsent) |
T |
getNow(T valueIfAbsent) |
boolean |
isCompletedExceptionally() |
T |
join() |
Promise<T> |
onCancel(Runnable action) |
Promise<T> |
onTimeout(Supplier<? extends T> supplier,
Duration duration) |
Promise<T> |
onTimeout(Supplier<? extends T> supplier,
Duration duration,
boolean cancelOnTimeout) |
Promise<T> |
onTimeout(Supplier<? extends T> supplier,
long timeout,
TimeUnit unit) |
Promise<T> |
onTimeout(Supplier<? extends T> supplier,
long timeout,
TimeUnit unit,
boolean cancelOnTimeout) |
Promise<T> |
onTimeout(T value,
Duration duration) |
Promise<T> |
onTimeout(T value,
Duration duration,
boolean cancelOnTimeout) |
Promise<T> |
onTimeout(T value,
long timeout,
TimeUnit unit) |
Promise<T> |
onTimeout(T value,
long timeout,
TimeUnit unit,
boolean cancelOnTimeout) |
Promise<T> |
orTimeout(Duration duration) |
Promise<T> |
orTimeout(Duration duration,
boolean cancelOnTimeout) |
Promise<T> |
orTimeout(long timeout,
TimeUnit unit) |
Promise<T> |
orTimeout(long timeout,
TimeUnit unit,
boolean cancelOnTimeout) |
Promise<T> |
raw()
Fully unwraps underlying
Promise (removes all decoration layers) |
Promise<T> |
thenFilter(Predicate<? super T> predicate) |
Promise<T> |
thenFilter(Predicate<? super T> predicate,
Function<? super T,Throwable> errorSupplier) |
Promise<T> |
thenFilterAsync(Predicate<? super T> predicate) |
Promise<T> |
thenFilterAsync(Predicate<? super T> predicate,
Executor executor) |
Promise<T> |
thenFilterAsync(Predicate<? super T> predicate,
Function<? super T,Throwable> errorSupplier) |
Promise<T> |
thenFilterAsync(Predicate<? super T> predicate,
Function<? super T,Throwable> errorSupplier,
Executor executor) |
Promise<T> |
unwrap()
Unwraps underlying
Promise if it was decorated (removes one level of decorators) |
cancel, get, get, isCancelled, isDoneacceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, handle, handleAsync, handleAsync, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, whenComplete, whenCompleteAsync, whenCompleteAsync, wrap, wrapNew, αtoCompletableFuture, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, as, exceptionally, handle, handleAsync, handleAsync, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, whenComplete, whenCompleteAsync, whenCompleteAsynctoCompletableFutureprotected AbstractPromiseDecorator(D delegate)
public T getNow(T valueIfAbsent) throws CancellationException, CompletionException
getNow in interface Promise<T>CancellationExceptionCompletionExceptionpublic T getNow(Supplier<? extends T> valueIfAbsent) throws CancellationException, CompletionException
getNow in interface Promise<T>CancellationExceptionCompletionExceptionpublic T join() throws CancellationException, CompletionException
join in interface Promise<T>CancellationExceptionCompletionExceptionpublic boolean isCompletedExceptionally()
isCompletedExceptionally in interface Promise<T>public Promise<T> unwrap()
PromisePromise if it was decorated (removes one level of decorators)public Promise<T> raw()
PromisePromise (removes all decoration layers)public DependentPromise<T> dependent()
PromisePromise to a DependentPromise
The returned DependentPromise does not implicitly enlist any CompletionStage
for cancellation (neither self, nor passed as arguments to combining methods);
only enlisting via explicit parameter is supportedpublic DependentPromise<T> dependent(Set<PromiseOrigin> defaultEnlistOptions)
PromisePromise to a DependentPromise
The returned DependentPromise does implicitly enlist CompletionStage
for cancellation (either self, and/or passed as arguments to combining methods)
according to defaultEnlistOptions parameterdependent in interface Promise<T>defaultEnlistOptions - defines what CompletionStage should be enlisted implicitly for cancellationpublic Promise<T> defaultAsyncOn(Executor executor)
defaultAsyncOn in interface Promise<T>public Promise<T> onTimeout(T value, long timeout, TimeUnit unit, boolean cancelOnTimeout)
public Promise<T> onTimeout(Supplier<? extends T> supplier, long timeout, TimeUnit unit, boolean cancelOnTimeout)
public Promise<T> onTimeout(Supplier<? extends T> supplier, Duration duration, boolean cancelOnTimeout)
public Promise<T> exceptionallyAsync(Function<Throwable,? extends T> fn)
exceptionallyAsync in interface Promise<T>exceptionallyAsync in class AbstractPromiseLikeDecorator<T,D extends Promise<T>>public Promise<T> exceptionallyAsync(Function<Throwable,? extends T> fn, Executor executor)
exceptionallyAsync in interface Promise<T>exceptionallyAsync in class AbstractPromiseLikeDecorator<T,D extends Promise<T>>public Promise<T> exceptionallyCompose(Function<Throwable,? extends CompletionStage<T>> fn)
exceptionallyCompose in interface Promise<T>exceptionallyCompose in class AbstractPromiseLikeDecorator<T,D extends Promise<T>>public Promise<T> exceptionallyComposeAsync(Function<Throwable,? extends CompletionStage<T>> fn)
exceptionallyComposeAsync in interface Promise<T>exceptionallyComposeAsync in class AbstractPromiseLikeDecorator<T,D extends Promise<T>>public Promise<T> exceptionallyComposeAsync(Function<Throwable,? extends CompletionStage<T>> fn, Executor executor)
exceptionallyComposeAsync in interface Promise<T>exceptionallyComposeAsync in class AbstractPromiseLikeDecorator<T,D extends 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> thenFilterAsync(Predicate<? super T> predicate, Executor executor)
thenFilterAsync in interface Promise<T>Copyright © 2021. All rights reserved.