Method Summary
All MethodsStatic MethodsConcrete Methods
Convenience method for creating a future that is immediately completed exceptionally with the given
Throwable
.Forward the
Completes theThrowable
fromsrc
todst
.dst
future based on the result of thesrc
future asynchronously on the providedExecutor
and return thesrc
future. Completes thedst
future based on the result of thesrc
future asynchronously on the providedExecutor
and return thesrc
future.Forward the
Completes theThrowable
that can be transformed as per the transformationFunction fromsrc
todst
.dst
future based on the result of thesrc
future, synchronously, after applying the provided transformationFunction
if successful.static <T> T
static void
static <T> T
Joins (interruptibly) on the future, and re-throws any RuntimeExceptions or Errors just like the async task would have thrown if it was executed synchronously.
Method Details
failedFuture
Convenience method for creating a future that is immediately completed exceptionally with the givenThrowable
.Similar to
Type Parameters:CompletableFuture#failedFuture
which was added in Java 9.U
- The type of the element. Parameters:t
- The failure. Returns: The failed future.errorAsCompletionException
Parameters:t
- The error. Returns: The error as a CompletionException.forwardExceptionTo
Forward the
Parameters:Throwable
fromsrc
todst
.src
- The source of theThrowable
.dst
- The destination where theThrowable
will be forwarded to. Returns:src
.forwardTransformedExceptionTo
Forward the
Parameters:Throwable
that can be transformed as per the transformationFunction fromsrc
todst
.src
- The source of theThrowable
.dst
- The destination where theThrowable
will be forwarded totransformationFunction
- Transformation function taht will be applied on to the forwarded exception. Returns:forwardResultTo
Completes thedst
future based on the result of thesrc
future asynchronously on the providedExecutor
and return thesrc
future. Parameters:src
- The sourceCompletableFuture
dst
- The destination where theThrowable
or response will be forwarded to. Returns: thesrc
future.forwardResultTo
Completes thedst
future based on the result of thesrc
future asynchronously on the providedExecutor
and return thesrc
future. Parameters:src
- The sourceCompletableFuture
dst
- The destination where theThrowable
or response will be forwarded to.executor
- the executor to complete the des future Returns: thesrc
future.forwardTransformedResultTo
Completes thedst
future based on the result of thesrc
future, synchronously, after applying the provided transformationFunction
if successful. Parameters:src
- The sourceCompletableFuture
dst
- The destination where theThrowable
or transformed result will be forwarded to. Returns: thesrc
future.allOfExceptionForwarded
Parameters:futures
- The futures. Returns: The new future that is completed when all the futures infutures
are.joinInterruptibly
joinInterruptiblyIgnoringFailures
joinLikeSync
Joins (interruptibly) on the future, and re-throws any RuntimeExceptions or Errors just like the async task would have thrown if it was executed synchronously.
ncG1vNJzZmirlKB7ornAs6anmaeoe6S7zGihmq6RZK6xtY6lmK2do6l8tLvFra6aqpVkrq6t2ailaJmnqMClt46uq6Kko2SQsLnPpZytmZKhsofB066pno2knrm0esetpKU%3D