org.datamanager.constraint
Class EventTypeIsConstraint
java.lang.Object
|
+--org.datamanager.kernel.AbstractEventConstraint
|
+--org.datamanager.constraint.EventTypeIsConstraint
- All Implemented Interfaces:
- Constraint, EntityValue, EventConstraint, Serializable
- public class EventTypeIsConstraint
- extends AbstractEventConstraint
Checks to see if the type of a DataManagerEvent
is valid or
not. Validity is tested by checking if the Class
passed into
the constructor is the same as or is a superinterface/superclass of the
Class
of a defendant DataManagerEvent
.
- Author:
- Matthew Farrellee
- See Also:
- Serialized Form
Constructor Summary |
EventTypeIsConstraint(Class target)
Creates a new EventTypeIsConstraint that will match
all DataManagerEvents that are of the given type,
this includes subtypes. |
Method Summary |
protected boolean |
describes(DataManagerEvent defendant)
Checks to see if the given DataManagerEvent is of
the type given in the constructor of this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventTypeIsConstraint
public EventTypeIsConstraint(Class target)
- Creates a new EventTypeIsConstraint that will match
all DataManagerEvents that are of the given type,
this includes subtypes.
- Parameters:
target
- The type to target.
- Throws:
IllegalArgumentException
- if target is null or
target is not a DataManagerEvent class.
describes
protected boolean describes(DataManagerEvent defendant)
throws DataManagerException
- Checks to see if the given DataManagerEvent is of
the type given in the constructor of this class.
- Specified by:
describes
in class AbstractEventConstraint
- Parameters:
defendant
- A DataManagerEvent to check.
- Returns:
- Whether the given event is of the right type.
DataManagerException
See the Helium Website