Class ChainedCompletableFuture<I,​O>

  • Type Parameters:
    I -
    O -

    public class ChainedCompletableFuture<I,​O>
    extends java.lang.Object
    A utility class to chain two completable futures together. This is useful when the future is initially an incomplete future, and we want to allow the caller to complete the future later. The caller can use the original future to complete, and use the result future to get the result. Ideally, the result is a part of the chain of the original future and executes on completion of the original future (or any of its dependent tasks).
    • Constructor Summary

      Constructors 
      Constructor Description
      ChainedCompletableFuture​(java.util.concurrent.CompletableFuture<I> originalFuture, java.util.concurrent.CompletableFuture<O> resultFuture)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<I> getOriginalFuture()  
      java.util.concurrent.CompletableFuture<O> getResultFuture()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChainedCompletableFuture

        public ChainedCompletableFuture​(java.util.concurrent.CompletableFuture<I> originalFuture,
                                        java.util.concurrent.CompletableFuture<O> resultFuture)
    • Method Detail

      • getOriginalFuture

        public java.util.concurrent.CompletableFuture<I> getOriginalFuture()
      • getResultFuture

        public java.util.concurrent.CompletableFuture<O> getResultFuture()