Interface MatchCondition

  • 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 interface MatchCondition
    Implement this method to test if the latest event matches the pattern. This allows for tests beyond simply matching the pattern.
    Author:
    Charles W. Rapp
    • Method Detail

      • test

        boolean test​(ENotificationMessage event,
                     Map<String,​List<ENotificationMessage>> groups,
                     Map<Object,​Object> userCache)
        Returns true if event satisfies this condition, allowing the event pattern matching to continue or complete. If event does not meet the pattern condition, then the current match is abandoned.

        Two further pieces of information are provided to help with the test: the capturing groups and the user-defined data cache (which see for more information).

        Note: if this method should throw any exception that is treated as a test failure and the current match is abandoned.

        Parameters:
        event - test if this event matches the pattern.
        groups - the capturing groups so far.
        userCache - map containing user data.
        Returns:
        true if event satisfies the match condition.