Check if an event should be registered/called.
If
false is returned the event will be ignored.
An exception can be thrown to signal the user that the event was invalid.
Example:
// Only allow EventBase events.
// If the event is called an exception is thrown.
// If the event is tried to be 'wildcard' registered it will be ignored.
// If the event is registered with an explicit type an exception is thrown.
public boolean check(final Class event, final CheckType checkType) {
if (event instanceof EventBase) return true;
if (CheckType.CALL.equals(checkType)) throw new IllegalArgumentException();
if (CheckType.EXPLICIT_REGISTER.equals(checkType)) throw new IllegalArgumentException();
return false;
}