Class FutureWrapper<K,V> (2.0.0)

public abstract class FutureWrapper<K,V> implements Future<V>

FutureWrapper is a simple Future that wraps a parent Future. This class is thread-safe.

Inheritance

java.lang.Object > FutureWrapper<K,V>

Implements

Future<V>

Type Parameters

NameDescription
K
V

Constructors

FutureWrapper(Future<K> parent)

public FutureWrapper(Future<K> parent)
Parameter
NameDescription
parentFuture<K>

Methods

absorbParentException(Throwable cause)

protected V absorbParentException(Throwable cause)

Override this method if you want to suppress an exception thrown by the parent and return a value instead.

Parameter
NameDescription
causeThrowable
Returns
TypeDescription
V
Exceptions
TypeDescription
Throwable

cancel(boolean mayInterruptIfRunning)

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

convertException(Throwable cause)

protected abstract Throwable convertException(Throwable cause)
Parameter
NameDescription
causeThrowable
Returns
TypeDescription
Throwable

equals(@Nullable Object obj)

public final boolean equals(@Nullable Object obj)
Parameter
NameDescription
obj@org.checkerframework.checker.nullness.qual.Nullable java.lang.Object
Returns
TypeDescription
boolean
Overrides

get()

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

get(long timeout, TimeUnit unit)

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

hashCode()

public final int hashCode()
Returns
TypeDescription
int
Overrides

isCancelled()

public boolean isCancelled()
Returns
TypeDescription
boolean

isDone()

public boolean isDone()
Returns
TypeDescription
boolean

wrap(@Nullable K key)

protected abstract V wrap(@Nullable K key)
Parameter
NameDescription
key@org.checkerframework.checker.nullness.qual.Nullable K
Returns
TypeDescription
V
Exceptions
TypeDescription
Exception