类 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 ornull
if the callback wasn't suitable.Return the result of the invocation or the given fallback if the callback wasn't suitable.boolean
Return true if a result in present.static <R> LambdaSafe.InvocationResult
<R> noResult()
Return anLambdaSafe.InvocationResult
instance representing no result.static <R> LambdaSafe.InvocationResult
<R> of
(R value) Create a newLambdaSafe.InvocationResult
instance 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 ornull
if 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.InvocationResult
instance with the specified value.- 类型参数:
R
- the result type- 参数:
value
- the value (may benull
)- 返回:
- an
LambdaSafe.InvocationResult
-
noResult
Return anLambdaSafe.InvocationResult
instance representing no result.- 类型参数:
R
- the result type- 返回:
- an
LambdaSafe.InvocationResult
-