public class Promise<T>
extends java.lang.Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
Promise.Builder<T>
Promise 对象构造器
|
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> Promise.Builder<T> |
newBuilder() |
static <T> Promise<T> |
of(java.util.concurrent.Callable<T> callable)
通过 of 静态方法返回 Promise 对象
|
void |
setData(T data) |
void |
setException(java.lang.Throwable exception) |
Promise<T> |
then(Resolve<T> resolve)
方法执行完毕后,对方法返回结果的处理
|
Promise<T> |
thenCatch(Reject reject)
方法出现异常的处理
|
Promise<T> |
thenFinally(java.lang.Runnable runnable)
方法最终的 finally 代码块
|
public Promise()
public Promise(java.util.concurrent.Callable<T> callable)
callable - 参数public static <T> Promise<T> of(java.util.concurrent.Callable<T> callable)
T - 泛型callable - 参数public Promise<T> then(Resolve<T> resolve)
resolve - 具体的处理public Promise<T> thenFinally(java.lang.Runnable runnable)
runnable - 具体的处理public void setData(T data)
public void setException(java.lang.Throwable exception)
public static <T> Promise.Builder<T> newBuilder()
Copyright © 2020. All Rights Reserved.