类 LambdaSafe.InvocationResult<R>
java.lang.Object
org.springframework.boot.util.LambdaSafe.InvocationResult<R>
- 类型参数:
R- the result type
- 封闭类:
LambdaSafe
The result of a callback which may be a value,
null or absent entirely if
the callback wasn't suitable. Similar in design to Optional but allows for
null as a valid value.-
方法概要
修饰符和类型方法说明get()Return the result of the invocation ornullif the callback wasn't suitable.Return the result of the invocation or the given fallback if the callback wasn't suitable.booleanReturn true if a result in present.static <R> LambdaSafe.InvocationResult<R> noResult()Return anLambdaSafe.InvocationResultinstance representing no result.static <R> LambdaSafe.InvocationResult<R> of(R value) Create a newLambdaSafe.InvocationResultinstance with the specified value.
-
方法详细资料
-
hasResult
public boolean hasResult()Return true if a result in present.- 返回:
- if a result is present
-
get
Return the result of the invocation ornullif the callback wasn't suitable.- 返回:
- the result of the invocation or
null
-
get
Return the result of the invocation or the given fallback if the callback wasn't suitable.- 参数:
fallback- the fallback to use when there is no result- 返回:
- the result of the invocation or the fallback
-
of
Create a newLambdaSafe.InvocationResultinstance with the specified value.- 类型参数:
R- the result type- 参数:
value- the value (may benull)- 返回:
- an
LambdaSafe.InvocationResult
-
noResult
Return anLambdaSafe.InvocationResultinstance representing no result.- 类型参数:
R- the result type- 返回:
- an
LambdaSafe.InvocationResult
-