T - The type of result of the CompletableFuturepublic interface WaitResultBuilder6<T>
CompletableFuture to create the
completable operation it self.| Modifier and Type | Method | Description |
|---|---|---|
CompletableFuture<Optional<T>> |
asyncExec() |
Create and start the async execution of the
CompletableFuture the
executor that was defined before. |
default Optional<T> |
finish() |
Directly wait for the result of this execution.
|
default T |
finishWithAResult() |
Directly wait for a positive result of this execution.
|
default Optional<T> |
get() |
Waits if necessary for the produced future to complete, and then returns its
result.
|
default Optional<T> |
join() |
Shortcut method to the join of the
CompletableFuture. |
default T |
joinWithAResult() |
Shortcut method to the join of the
CompletableFuture, that expect a
positive result. |
default CompletionStage<Optional<T>> |
minimalCompletionStage() |
Returns a new CompletionStage that is completed normally based on this
CompletableFuture. |
default CompletableFuture<Optional<T>> |
orTimeout(long timeout,
TimeUnit unit) |
Create and start the async execution of the
CompletableFuture and
exceptionally completes this CompletableFuture with a TimeoutException if not
otherwise completed before the given timeout. |
default CompletableFuture<Void> |
thenAccept(Consumer<? super Optional<T>> action) |
Create and start the async execution of the
CompletableFuture and
directly register a Consumer on the result. |
default <U> CompletableFuture<U> |
thenApply(Function<? super Optional<T>,? extends U> fn) |
Create and start the async execution of the
CompletableFuture and
directly register a Function on the result. |
CompletableFuture<Optional<T>> asyncExec()
CompletableFuture the
executor that was defined before.CompletableFuturedefault Optional<T> finish()
AssertionError is thrown.Optional with the result of the executionAssertionError - In case of not ignored exception.default T finishWithAResult()
AssertionError is
thrown.AssertionError - In case of not ignored exception or missing result.default Optional<T> join()
CompletableFuture.
Only runtime exception in case of error.
CompletableFuture.join()default T joinWithAResult()
CompletableFuture, that expect a
positive result.
Only runtime exception in case of error.
CompletableFuture.join()default CompletableFuture<Void> thenAccept(Consumer<? super Optional<T>> action)
CompletableFuture and
directly register a Consumer on the result.action - the action to be done on the resultCompletableFutureCompletableFuture.thenAccept(Consumer)default <U> CompletableFuture<U> thenApply(Function<? super Optional<T>,? extends U> fn)
CompletableFuture and
directly register a Function on the result.U - The new return typefn - then function to be appliedCompletableFutureCompletableFuture.thenApply(Function)default CompletableFuture<Optional<T>> orTimeout(long timeout, TimeUnit unit)
CompletableFuture and
exceptionally completes this CompletableFuture with a TimeoutException if not
otherwise completed before the given timeout.timeout - how long to wait before completing exceptionally with a
TimeoutException, in units of unitunit - a TimeUnit determining how to interpret the timeout parameterCompletableFutureCompletableFuture.orTimeout(long, TimeUnit)default CompletionStage<Optional<T>> minimalCompletionStage()
CompletableFuture.CompletableFuture.minimalCompletionStage()default Optional<T> get() throws InterruptedException, ExecutionException
CancellationException - if the produced future was cancelledExecutionException - if the produced future completed exceptionallyInterruptedException - if the current thread was interrupted while waitingCompletableFuture.get()Copyright © 2019. All rights reserved.