类 SucceededFuture<V>
java.lang.Object
cn.taketoday.util.concurrent.AbstractFuture<V>
cn.taketoday.util.concurrent.CompleteFuture<V>
cn.taketoday.util.concurrent.SucceededFuture<V>
- 所有已实现的接口:
ListenableFuture<V>,Future<V>
The
CompleteFuture which is succeeded already.- 从以下版本开始:
- 4.0 2024/2/26 21:33
- 作者:
- Harry Yang
-
字段概要
字段 -
构造器概要
构造器构造器说明SucceededFuture(Executor executor, V result) Creates a new instance.SucceededFuture(V result) Creates a new instance. -
方法概要
从类继承的方法 cn.taketoday.util.concurrent.CompleteFuture
addListener, addListeners, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, cancel, executor, isCancellable, isCancelled, isDone, removeListener, removeListeners, sync, syncUninterruptibly从类继承的方法 cn.taketoday.util.concurrent.AbstractFuture
get, get, obtain从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.util.concurrent.ListenableFuture
addListener, completable, onFailure, onSuccess
-
字段详细资料
-
result
-
-
构造器详细资料
-
SucceededFuture
Creates a new instance. -
SucceededFuture
Creates a new instance.- 参数:
executor- theExecutorassociated with this future
-
-
方法详细资料
-
getCause
从接口复制的说明:ListenableFutureReturns the cause of the failed operation if the operation failed.- 返回:
- the cause of the failure.
nullif succeeded or this future is not completed yet.
-
isSuccess
public boolean isSuccess()从接口复制的说明:ListenableFutureReturnstrueif and only if the operation was completed successfully. -
getNow
从接口复制的说明:ListenableFutureReturn the result without blocking. If the future is not done yet this will returnnull.As it is possible that a
nullvalue is used to mark the future as successful you also need to check if the future is really done withFuture.isDone()and not rely on the returnednullvalue.
-