CompletableFutureUtils (AWS SDK for Java

JavaScript is disabled on your browser. All MethodsStatic MethodsConcrete Methods Convenience method for creating a future that is immediately completed exceptionally with the given Throwable. Forward the Throwable from src to dst.

CompletableFutureUtils (AWS SDK for Java - 2.25.21) public final class CompletableFutureUtils extends Object
  • Method Summary

    All MethodsStatic MethodsConcrete Methods

    Convenience method for creating a future that is immediately completed exceptionally with the given Throwable.

    Forward the Throwable from src to dst.

    Completes the dst future based on the result of the src future asynchronously on the provided Executor and return the src future. Completes the dst future based on the result of the src future asynchronously on the provided Executor and return the src future.

    Forward the Throwable that can be transformed as per the transformationFunction from src to dst.

    Completes the dst future based on the result of the src future, synchronously, after applying the provided transformation Function 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 given Throwable.

      Similar to CompletableFuture#failedFuture which was added in Java 9.

      Type Parameters: 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 Throwable from src to dst.

      Parameters: src - The source of the Throwable. dst - The destination where the Throwable will be forwarded to. Returns: src.
    • forwardTransformedExceptionTo

      Forward the Throwable that can be transformed as per the transformationFunction from src to dst.

      Parameters: src - The source of the Throwable. dst - The destination where the Throwable will be forwarded to transformationFunction - Transformation function taht will be applied on to the forwarded exception. Returns:
    • forwardResultTo

      Completes the dst future based on the result of the src future asynchronously on the provided Executor and return the src future. Parameters: src - The source CompletableFuture dst - The destination where the Throwable or response will be forwarded to. Returns: the src future.
    • forwardResultTo

      Completes the dst future based on the result of the src future asynchronously on the provided Executor and return the src future. Parameters: src - The source CompletableFuture dst - The destination where the Throwable or response will be forwarded to. executor - the executor to complete the des future Returns: the src future.
    • forwardTransformedResultTo

      Completes the dst future based on the result of the src future, synchronously, after applying the provided transformation Function if successful. Parameters: src - The source CompletableFuture dst - The destination where the Throwable or transformed result will be forwarded to. Returns: the src future.
    • allOfExceptionForwarded

      Parameters: futures - The futures. Returns: The new future that is completed when all the futures in futures 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

 Share!