public final class EventFieldFilter extends java.lang.Object implements EventFilter
EventFilter
which allows all the events but trims some of their message fields.
By default, the input event is returned unchanged. Specify a FieldMask
for an event
type to trim certain fields off the event messages. The fields in the mask are
retained, all the others are cleared.
Note that the mask should contain all the (required) = true
fields. Otherwise,
the event will not be acknowledged by the bus.
Modifier and Type | Class and Description |
---|---|
static class |
EventFieldFilter.Builder
A builder for the
EventFieldFilter instances. |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableCollection<io.spine.core.Event> |
filter(java.util.Collection<io.spine.core.Event> events)
Applies this filter to the given
Event s in bulk. |
java.util.Optional<? extends io.spine.base.EventMessage> |
filter(io.spine.base.EventMessage event)
Applies this filter to the given event.
|
static EventFieldFilter.Builder |
newBuilder()
Creates a new instance of
Builder for EventFieldFilter instances. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allowAll
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 com.google.common.collect.ImmutableCollection<io.spine.core.Event> filter(java.util.Collection<io.spine.core.Event> events)
EventFilter
Event
s in bulk.filter
in interface EventFilter
events
- the events to apply the filter topublic static EventFieldFilter.Builder newBuilder()
Builder
for EventFieldFilter
instances.Builder