类 LambdaSafe.Callback<C,A>

java.lang.Object
cn.taketoday.util.LambdaSafe.LambdaSafeCallback<C,A,LambdaSafe.Callback<C,A>>
cn.taketoday.util.LambdaSafe.Callback<C,A>
类型参数:
C - the callback type
A - the primary argument type
封闭类:
LambdaSafe

public static final class LambdaSafe.Callback<C,A> extends LambdaSafe.LambdaSafeCallback<C,A,LambdaSafe.Callback<C,A>>
Represents a single callback that can be invoked in a lambda safe way.
  • 字段详细资料

    • callbackInstance

      private final C callbackInstance
  • 构造器详细资料

    • Callback

      private Callback(Class<C> callbackType, C callbackInstance, A argument, Object[] additionalArguments)
  • 方法详细资料

    • invoke

      public void invoke(Consumer<C> invoker)
      Invoke the callback instance where the callback method returns void.
      参数:
      invoker - the invoker used to invoke the callback
    • invokeAnd

      public <R> LambdaSafe.InvocationResult<R> invokeAnd(Function<C,R> invoker)
      Invoke the callback instance where the callback method returns a result.
      类型参数:
      R - the result type
      参数:
      invoker - the invoker used to invoke the callback
      返回:
      the result of the invocation (may be LambdaSafe.InvocationResult.noResult() if the callback was not invoked)