Class TopicFilter

java.lang.Object
dev.agenor.runtime.filter.TopicFilter
All Implemented Interfaces:
MessageFilter, Predicate<Message>

public class TopicFilter extends Object implements MessageFilter
Filter messages by topic patterns
  • Method Details

    • test

      public boolean test(Message message)
      Description copied from interface: MessageFilter
      Test if the message matches this filter
      Specified by:
      test in interface MessageFilter
      Specified by:
      test in interface Predicate<Message>
      Parameters:
      message - the message to test
      Returns:
      true if the message matches the filter criteria
    • exact

      public static TopicFilter exact(String topic)
      Match exact topic
    • startsWith

      public static TopicFilter startsWith(String prefix)
      Match topic prefix
    • endsWith

      public static TopicFilter endsWith(String suffix)
      Match topic suffix
    • wildcard

      public static TopicFilter wildcard(String pattern)
      Match topic with wildcard (* = any characters)
    • regex

      public static TopicFilter regex(String regex)
      Match topic with regex