org.springframework.util.concurrent

## 类 ListenableFutureAdapter<T,S>

- java.lang.Object
- - org.springframework.util.concurrent.FutureAdapter<T,S>
  - - org.springframework.util.concurrent.ListenableFutureAdapter<T,S>

- 类型参数:
    `T` - the type of this `Future`
    `S` - the type of the adaptee's `Future`
  所有已实现的接口:
    Future<T>, ListenableFuture<T>

      public abstract class ListenableFutureAdapter<T,S>
      extends FutureAdapter<T,S>
      implements ListenableFuture<T>

  Abstract class that adapts a `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.
  从以下版本开始:
    4.0
  作者:
    Arjen Poutsma

- - ### 构造器概要

    构造器
    限定符 | 构造器和说明
    --- | ---
    `protected` | `ListenableFutureAdapter(ListenableFuture<S> adaptee)` Construct a new `ListenableFutureAdapter` with the given adaptee.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `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.

    - ### 从类继承的方法 org.springframework.util.concurrent.FutureAdapter

      `adapt, cancel, get, get, getAdaptee, isCancelled, isDone`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### 从接口继承的方法 org.springframework.util.concurrent.ListenableFuture

      `completable`

    - ### 从接口继承的方法 java.util.concurrent.Future

      `cancel, get, get, isCancelled, isDone`

- - ### 构造器详细资料

    - #### ListenableFutureAdapter

          protected ListenableFutureAdapter(ListenableFuture<S> adaptee)

      Construct a new `ListenableFutureAdapter` with the given adaptee.
      参数:
        `adaptee` - the future to adapt to

  - ### 方法详细资料

    - #### addCallback

          public void addCallback(ListenableFutureCallback<? super T> callback)

      从接口复制的说明: `ListenableFuture`
      Register the given `ListenableFutureCallback`.
      指定者:
        `addCallback` 在接口中 `ListenableFuture<T>`
      参数:
        `callback` - the callback to register

    - #### addCallback

          public void addCallback(SuccessCallback<? super T> successCallback,
                                  FailureCallback failureCallback)

      从接口复制的说明: `ListenableFuture`
      Java 8 lambda-friendly alternative with success and failure callbacks.
      指定者:
        `addCallback` 在接口中 `ListenableFuture<T>`
      参数:
        `successCallback` - the success callback
        `failureCallback` - the failure callback