bobocep.cep.engine.receiver.validator.BoboValidatorType

class bobocep.cep.engine.receiver.validator.BoboValidatorType(types: List[type], subtype: bool = True)[source]

Bases: BoboValidator

Validates whether the entity type matches any of the given data types. If the data are a BoboEvent, then the event’s data are checked instead.

__init__(types: List[type], subtype: bool = True)[source]
Parameters:
  • types – The types of which the data must match at least one for the data to be valid.

  • subtype – If True, subtypes of a type are also valid. If False, data must match exact type.

is_valid(data: Any) bool[source]
Returns:

True if the data matches a type; False otherwise.