Class TopicEventFilter

  • All Implemented Interfaces:

    public class TopicEventFilter
    extends Object
    implements EventFilter
    The TopicEventFilter is a default openHAB EventFilter implementation that ensures filtering of events based on an event topic.
    Stefan Bußweiler - Initial contribution
    • Constructor Detail

      • TopicEventFilter

        public TopicEventFilter​(String topicRegex)
        Constructs a new topic event filter.
        topicRegex - the regular expression of a topic
        See Also:
        Java Regex
    • Method Detail

      • apply

        public boolean apply​(Event event)
        Description copied from interface: EventFilter
        Apply the filter on an event.

        This method is called for each subscribed Event of an EventSubscriber. If the filter applies, the event will be dispatched to the EventSubscriber.receive(Event) method.

        Specified by:
        apply in interface EventFilter
        event - the event (not null)
        true if the filter criterion applies