Module dev.mccue.guava.concurrent
Package dev.mccue.guava.concurrent
Class ForwardingFuture<V extends @Nullable Object>
java.lang.Object
dev.mccue.guava.collect.ForwardingObject
dev.mccue.guava.concurrent.ForwardingFuture<V>
- All Implemented Interfaces:
Future<V>
- Direct Known Subclasses:
ForwardingFuture.SimpleForwardingFuture,ForwardingListenableFuture
public abstract class ForwardingFuture<V extends @Nullable Object>
extends dev.mccue.guava.collect.ForwardingObject
implements Future<V>
A
Future which forwards all its method calls to another future. Subclasses should
override one or more methods to modify the behavior of the backing future as desired per the decorator pattern.
Most subclasses can just use ForwardingFuture.SimpleForwardingFuture.
- Since:
- 1.0
- Author:
- Sven Mawson
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classForwardingFuture.SimpleForwardingFuture<V extends @Nullable Object>A simplified version ofForwardingFuturewhere subclasses can pass in an already constructedFutureas the delegate. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class dev.mccue.guava.collect.ForwardingObject
toString
-
Constructor Details
-
ForwardingFuture
protected ForwardingFuture()Constructor for use by subclasses.
-
-
Method Details
-
delegate
- Specified by:
delegatein classdev.mccue.guava.collect.ForwardingObject
-
cancel
@CanIgnoreReturnValue public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<V extends @Nullable Object>
-
isDone
public boolean isDone() -
get
- Specified by:
getin interfaceFuture<V extends @Nullable Object>- Throws:
InterruptedExceptionExecutionException
-
get
@CanIgnoreReturnValue public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<V extends @Nullable Object>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-