T
- the type of this Future
S
- the type of the adaptee's Future
public abstract class ListenableFutureAdapter<T,S> extends FutureAdapter<T,S> implements ListenableFuture<T>
ListenableFuture
parameterized over S into a
ListenableFuture
parameterized over T. All methods are delegated to the
adaptee, where FutureAdapter.get()
, FutureAdapter.get(long, java.util.concurrent.TimeUnit)
,
and SuccessCallback.onSuccess(Object)
call FutureAdapter.adapt(Object)
on the adaptee's result.Modifier | Constructor and Description |
---|---|
protected |
ListenableFutureAdapter(ListenableFuture<S> adaptee)
Construct a new
ListenableFutureAdapter with the given adaptee. |
Modifier and Type | Method and Description |
---|---|
void |
addCallback(ListenableFutureCallback<? super T> callback)
Register the given
ListenableFutureCallback . |
void |
addCallback(SuccessCallback<? super T> successCallback,
FailureCallback failureCallback)
Java 8 lambda-friendly alternative with success and failure callbacks.
|
adapt, cancel, get, get, getAdaptee, isCancelled, isDone
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
completable
protected ListenableFutureAdapter(ListenableFuture<S> adaptee)
ListenableFutureAdapter
with the given adaptee.adaptee
- the future to adapt topublic void addCallback(ListenableFutureCallback<? super T> callback)
ListenableFuture
ListenableFutureCallback
.addCallback
in interface ListenableFuture<T>
callback
- the callback to registerpublic void addCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback)
ListenableFuture
addCallback
in interface ListenableFuture<T>
successCallback
- the success callbackfailureCallback
- the failure callback