类 LambdaSafe.InvocationResult<R>

  • 类型参数:
    R - the result type
    封闭类:
    LambdaSafe

    public static final class LambdaSafe.InvocationResult<R>
    extends Object
    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.
    • 方法详细资料

      • hasResult

        public boolean hasResult()
        Return true if a result in present.
        返回:
        if a result is present
      • get

        public R get()
        Return the result of the invocation or null if the callback wasn't suitable.
        返回:
        the result of the invocation or null
      • get

        public R get​(R fallback)
        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