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

Name Description
K
V

Constructors

FutureWrapper(Future<K> parent)

public FutureWrapper(Future<K> parent)
Parameter
Name Description
parent Future<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
Name Description
cause Throwable
Returns
Type Description
V
Exceptions
Type Description
Throwable

cancel(boolean mayInterruptIfRunning)

public boolean cancel(boolean mayInterruptIfRunning)
Parameter
Name Description
mayInterruptIfRunning boolean
Returns
Type Description
boolean

convertException(Throwable cause)

protected abstract Throwable convertException(Throwable cause)
Parameter
Name Description
cause Throwable
Returns
Type Description
Throwable

equals(@Nullable Object obj)

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

get()

public V get()
Returns
Type Description
V
Exceptions
Type Description
ExecutionException
InterruptedException

get(long timeout, TimeUnit unit)

public V get(long timeout, TimeUnit unit)
Parameters
Name Description
timeout long
unit TimeUnit
Returns
Type Description
V
Exceptions
Type Description
InterruptedException
TimeoutException
ExecutionException

hashCode()

public final int hashCode()
Returns
Type Description
int
Overrides

isCancelled()

public boolean isCancelled()
Returns
Type Description
boolean

isDone()

public boolean isDone()
Returns
Type Description
boolean

wrap(@Nullable K key)

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