Constructor and Description |
---|
OriginFilter(ParticipantId origin)
Constructor.
|
OriginFilter(ParticipantId origin,
boolean invert)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object that) |
ParticipantId |
getOrigin()
Returns the origin participant id this filter operates for.
|
int |
hashCode() |
boolean |
isInverted()
Indicates whether the filter accepts events only from the id returned by
getOrigin() or it only accepts events that do not originate from
that origin. |
boolean |
match(Event event)
Tells whether the given event matches the filter and hence shall be
dispatched or not.
|
public OriginFilter(ParticipantId origin, boolean invert)
origin
- the desired origin of a received event, not null
invert
- if true
, suppress events from the provided origin
and allow all other events instead of only allowing events
from that origin.IllegalArgumentException
- origin is null
public OriginFilter(ParticipantId origin)
origin
- only events from this origin are allowed, not
null
IllegalArgumentException
- origin is null
public ParticipantId getOrigin()
null
public boolean isInverted()
getOrigin()
or it only accepts events that do not originate from
that origin.true
, only events NOT originating from
getOrigin()
are allowed. If false
, only
events from getOrigin()
are allowed.public boolean match(Event event)
Filter
Copyright © 2018 CoR-Lab. All rights reserved.