Package org.openhab.core.events
Class TopicEventFilter
java.lang.Object
org.openhab.core.events.TopicEventFilter
- All Implemented Interfaces:
EventFilter
The
TopicEventFilter is a default openHAB EventFilter implementation that ensures filtering
of events based on a single event topic or multiple event topics.- Author:
- Stefan Bußweiler - Initial contribution, Florian Hotze - Add support for filtering of events by multiple event topics
-
Constructor Summary
ConstructorsConstructorDescriptionTopicEventFilter(String topicRegex) Constructs a new topic event filter.TopicEventFilter(List<String> topicsRegexes) Constructs a new topic event filter. -
Method Summary
-
Constructor Details
-
TopicEventFilter
Constructs a new topic event filter.- Parameters:
topicRegex- the regular expression of a topic- See Also:
-
TopicEventFilter
Constructs a new topic event filter.- Parameters:
topicsRegexes- the regular expressions of multiple topics- See Also:
-
-
Method Details
-
apply
Description copied from interface:EventFilterApply the filter on an event.This method is called for each subscribed
Eventof anEventSubscriber. If the filter applies, the event will be dispatched to theEventSubscriber.receive(Event)method.- Specified by:
applyin interfaceEventFilter- Parameters:
event- the event (not null)- Returns:
- true if the filter criterion applies
-