public final class CompositeEventFilter extends java.lang.Object implements EventFilter
EventFilter
which composes several other filters.
The filters are applied to the input event one by one in the order of addition. The next filter is applied to the result of the previous filter. If a filter returns an empty result, the whole composite filter returns an empty result at once.
Modifier and Type | Class and Description |
---|---|
static class |
CompositeEventFilter.Builder
A builder for the
CompositeEventFilter instances. |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<? extends io.spine.base.EventMessage> |
filter(io.spine.base.EventMessage event)
Applies this filter to the given event.
|
static CompositeEventFilter.Builder |
newBuilder()
Creates a new instance of
Builder for CompositeEventFilter instances. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allowAll, filter
public java.util.Optional<? extends io.spine.base.EventMessage> filter(io.spine.base.EventMessage event)
EventFilter
filter
in interface EventFilter
event
- the event to apply the filter toOptional.empty()
if the event should not be postedpublic static CompositeEventFilter.Builder newBuilder()
Builder
for CompositeEventFilter
instances.Builder