T - The type of result of the CompletableFuturepublic interface WaitResultBuilder5<T> extends Supplier<Optional<T>>
CompletableFuture to define the
executor it self.| Modifier and Type | Method | Description |
|---|---|---|
default CompletableFuture<Optional<T>> |
asyncExec() |
Create and start the async execution of the
CompletableFuture using
ForkJoinPool.commonPool(). |
default CompletableFuture<Optional<T>> |
asyncExec(Executor executor) |
Deprecated.
Replaced by
using(executor).asyncExec() |
WaitResultBuilder5<T> |
filter(Predicate<T> filter) |
Add a filter predicate, on the result, if applicable.
|
default Optional<T> |
finish() |
Directly wait for the result of this execution using
ForkJoinPool.commonPool(). |
default Optional<T> |
finish(Executor executor) |
Deprecated.
Replaced by
using(executor).finish() |
default T |
finishWithAResult() |
Directly wait for a positive result of this execution using
ForkJoinPool.commonPool(). |
default T |
finishWithAResult(Executor executor) |
Deprecated.
Replaced by
using(executor).finishWithAResult() |
Optional<T> |
get() |
Directly wait for the result of this execution (the execution is run in this
thread).
|
<U> WaitResultBuilder5<U> |
map(Function<T,U> mapper) |
Add a mapper fonction, on the result, if applicable.
|
static <T> WaitResultBuilder5<T> |
of(Supplier<Optional<T>> supplier) |
Used internally to create the builder
|
WaitResultBuilder6<T> |
using(Executor executor) |
Define the executor to be used for the async part.
|
default WaitResultBuilder6<T> |
usingDefaultExecutor() |
Define the executor to be used for the async part as using
ForkJoinPool.commonPool(). |
Optional<T> get()
AssertionError is
thrown.get in interface Supplier<T>Optional with the result of the executionAssertionError - In case of not ignored exception.WaitResultBuilder6<T> using(Executor executor)
executor - the executor to be used.the final stepdefault WaitResultBuilder6<T> usingDefaultExecutor()
ForkJoinPool.commonPool().the final step@Deprecated default CompletableFuture<Optional<T>> asyncExec(Executor executor)
using(executor).asyncExec()CompletableFuture.executor - the executor to be used.CompletableFuturedefault CompletableFuture<Optional<T>> asyncExec()
CompletableFuture using
ForkJoinPool.commonPool().CompletableFuture@Deprecated default Optional<T> finish(Executor executor)
using(executor).finish()AssertionError is thrown.executor - the executor to be used.Optional with the result of the executionAssertionError - In case of not ignored exception.default Optional<T> finish()
ForkJoinPool.commonPool(). In case of not ignored exception, an
AssertionError is thrown.Optional with the result of the executionAssertionError - In case of not ignored exception.@Deprecated default T finishWithAResult(Executor executor)
using(executor).finishWithAResult()AssertionError is
thrown.executor - the executor to be used.AssertionError - In case of not ignored exception or missing result.default T finishWithAResult()
ForkJoinPool.commonPool(). In case of not ignored exception, or when
no result are available, an AssertionError is thrown.AssertionError - In case of not ignored exception or missing result.<U> WaitResultBuilder5<U> map(Function<T,U> mapper)
U - the target of the mapper.mapper - the function to convert the result.WaitResultBuilder5 continuation of the builderOptional.map(Function)WaitResultBuilder5<T> filter(Predicate<T> filter)
filter - the filterWaitResultBuilder5 continuation of the builderOptional.filter(Predicate)static <T> WaitResultBuilder5<T> of(Supplier<Optional<T>> supplier)
T - The type of the target optionalsupplier - the supplierCopyright © 2019. All rights reserved.