Class ApiFutureToCompletableFutureWrapper<V>

  • All Implemented Interfaces:
    com.google.api.core.ApiFutureCallback<V>, java.util.concurrent.CompletionStage<V>, java.util.concurrent.Future<V>

    class ApiFutureToCompletableFutureWrapper<V>
    extends java.util.concurrent.CompletableFuture<V>
    implements com.google.api.core.ApiFutureCallback<V>
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture

        java.util.concurrent.CompletableFuture.AsynchronousCompletionTask
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private com.google.api.core.ApiFuture<V> future  
    • Constructor Summary

      Constructors 
      Constructor Description
      ApiFutureToCompletableFutureWrapper​(com.google.api.core.ApiFuture<V> future, java.util.concurrent.Executor executor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean cancel​(boolean mayInterruptIfRunning)  
      void onFailure​(java.lang.Throwable t)  
      void onSuccess​(V result)  
      (package private) com.google.api.core.ApiFuture<V> unwrap()  
      • Methods inherited from class java.util.concurrent.CompletableFuture

        acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, complete, completeAsync, completeAsync, completedFuture, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • future

        private final com.google.api.core.ApiFuture<V> future
    • Constructor Detail

      • ApiFutureToCompletableFutureWrapper

        ApiFutureToCompletableFutureWrapper​(com.google.api.core.ApiFuture<V> future,
                                            java.util.concurrent.Executor executor)
    • Method Detail

      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<V>
        Overrides:
        cancel in class java.util.concurrent.CompletableFuture<V>
      • unwrap

        com.google.api.core.ApiFuture<V> unwrap()
      • onSuccess

        public void onSuccess​(V result)
        Specified by:
        onSuccess in interface com.google.api.core.ApiFutureCallback<V>
      • onFailure

        public void onFailure​(java.lang.Throwable t)
        Specified by:
        onFailure in interface com.google.api.core.ApiFutureCallback<V>