Interface LambdaSafe.Filter<C,A>

Type Parameters:
C - the callback type
A - the primary argument type
Enclosing class:
LambdaSafe
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface LambdaSafe.Filter<C,A>
A filter that can be used to restrict when a callback is used.
Since:
3.4.8
  • Method Summary

    Modifier and Type
    Method
    Description
    static <C, A> LambdaSafe.Filter<C,A>
    Return a LambdaSafe.Filter that allows all callbacks to be invoked.
    boolean
    match(Class<C> callbackType, C callbackInstance, A argument, Object[] additionalArguments)
    Determine if the given callback matches and should be invoked.
  • Method Details

    • match

      boolean match(Class<C> callbackType, C callbackInstance, A argument, Object[] additionalArguments)
      Determine if the given callback matches and should be invoked.
      Parameters:
      callbackType - the callback type (the functional interface)
      callbackInstance - the callback instance (the implementation)
      argument - the primary argument
      additionalArguments - any additional arguments
      Returns:
      if the callback matches and should be invoked
    • allowAll

      static <C, A> LambdaSafe.Filter<C,A> allowAll()
      Return a LambdaSafe.Filter that allows all callbacks to be invoked.
      Type Parameters:
      C - the callback type
      A - the primary argument type
      Returns:
      an "allow all" filter