Class CompletableToApiFutureWrapper<V>

  • All Implemented Interfaces:
    com.google.api.core.ApiFuture<V>, com.google.common.util.concurrent.ListenableFuture<V>, java.util.concurrent.Future<V>, java.util.function.BiConsumer<V,​java.lang.Throwable>

    class CompletableToApiFutureWrapper<V>
    extends com.google.common.util.concurrent.AbstractFuture<V>
    implements com.google.api.core.ApiFuture<V>, java.util.function.BiConsumer<V,​java.lang.Throwable>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.CompletionStage<V> future  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(V v, java.lang.Throwable throwable)  
      boolean cancel​(boolean mayInterruptIfRunning)  
      java.util.concurrent.CompletableFuture<V> unwrap()  
      • Methods inherited from class com.google.common.util.concurrent.AbstractFuture

        addListener, afterDone, get, get, interruptTask, isCancelled, isDone, pendingToString, set, setException, setFuture, toString, wasInterrupted
      • Methods inherited from class com.google.common.util.concurrent.FluentFuture

        addCallback, catching, catchingAsync, from, transform, transformAsync, withTimeout
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.google.api.core.ApiFuture

        addListener
      • Methods inherited from interface java.util.function.BiConsumer

        andThen
      • Methods inherited from interface java.util.concurrent.Future

        get, get, isCancelled, isDone
    • Field Detail

      • future

        private final java.util.concurrent.CompletionStage<V> future
    • Constructor Detail

      • CompletableToApiFutureWrapper

        CompletableToApiFutureWrapper​(java.util.concurrent.CompletionStage<V> future)
    • Method Detail

      • unwrap

        public java.util.concurrent.CompletableFuture<V> unwrap()
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<V>
        Overrides:
        cancel in class com.google.common.util.concurrent.AbstractFuture<V>
      • accept

        public void accept​(V v,
                           java.lang.Throwable throwable)
        Specified by:
        accept in interface java.util.function.BiConsumer<V,​java.lang.Throwable>