public final class EventWhiteList extends java.lang.Object implements EventFilter
EventFilterwhich allows only events of given types.
All the other events are discarded by this filter by default.
Caution: when using this filter, make sure you're aware of consequences of discarding system events posted by a repository.
|Modifier and Type||Method and Description|
Creates a new instance of
Applies this filter to the given event.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@SafeVarargs public static EventWhiteList allowEvents(java.lang.Class<? extends io.spine.base.EventMessage>... eventClasses)
EventWhiteListallowing events of the given types.
eventClasses- the allowed event classes
public java.util.Optional<? extends io.spine.base.EventMessage> filter(io.spine.base.EventMessage event)