Class AbstractApiFuture<V> (2.7.0)

public abstract class AbstractApiFuture<V> implements ApiFuture<V>

Abstract implementation of ApiFuture that mirrors AbstractFuture in Guava.

Inheritance

java.lang.Object > AbstractApiFuture<V>

Implements

com.google.api.core.ApiFuture<V>

Type Parameter

NameDescription
V

Constructors

AbstractApiFuture()

public AbstractApiFuture()

Methods

addListener(Runnable listener, Executor executor)

public void addListener(Runnable listener, Executor executor)
Parameters
NameDescription
listenerRunnable
executorExecutor

cancel(boolean mayInterruptIfRunning)

public boolean cancel(boolean mayInterruptIfRunning)
Parameter
NameDescription
mayInterruptIfRunningboolean
Returns
TypeDescription
boolean

get()

public V get()
Returns
TypeDescription
V
Exceptions
TypeDescription
InterruptedException
ExecutionException

get(long timeout, TimeUnit unit)

public V get(long timeout, TimeUnit unit)
Parameters
NameDescription
timeoutlong
unitTimeUnit
Returns
TypeDescription
V
Exceptions
TypeDescription
InterruptedException
ExecutionException
TimeoutException

interruptTask()

protected void interruptTask()

isCancelled()

public boolean isCancelled()
Returns
TypeDescription
boolean

isDone()

public boolean isDone()
Returns
TypeDescription
boolean

set(V value)

protected boolean set(V value)
Parameter
NameDescription
valueV
Returns
TypeDescription
boolean

setException(Throwable throwable)

protected boolean setException(Throwable throwable)
Parameter
NameDescription
throwableThrowable
Returns
TypeDescription
boolean