Class LambdaSafe.Callbacks<C,A>

java.lang.Object
io.spring.initializr.generator.spring.util.LambdaSafe.Callbacks<C,A>
Type Parameters:
C - the callback type
A - the primary argument type
Enclosing class:
LambdaSafe

public static final class LambdaSafe.Callbacks<C,A> extends Object
Represents a collection of callbacks that can be invoked in a lambda safe way.
  • Method Details

    • invoke

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

      public <R> Stream<R> invokeAnd(Function<C,R> invoker)
      Invoke the callback instances where the callback method returns a result.
      Type Parameters:
      R - the result type
      Parameters:
      invoker - the invoker used to invoke the callback
      Returns:
      the results of the invocation (may be an empty stream if no callbacks could be called)
    • invoke

      protected final <R> LambdaSafe.InvocationResult<R> invoke(C callbackInstance, Supplier<R> supplier)