bobocep.cep.event.event.BoboEvent

class bobocep.cep.event.event.BoboEvent(event_id: str, timestamp: int, data: Any)[source]

Bases: bobocep.bobocep.BoboJSONable, abc.ABC

An abstract event.

__init__(event_id: str, timestamp: int, data: Any)[source]
Parameters
  • event_id – The event ID.

  • timestamp – The event timestamp.

  • data – The event data.

Raises

BoboEventError – If length of event ID is equal to 0.

abstract cast(dtype: type) bobocep.cep.event.event.BoboEvent[source]
Parameters

dtype – The type to which the event’s data is cast.

Returns

A new BoboEvent instance with its data cast to dtype and all other properties identical to the original event.

property data: Any

Get event data.

property event_id: str

Get event ID.

abstract static from_json_dict(d: dict) bobocep.bobocep.BoboJSONable
Parameters

d – A JSON dict representation of an object of this type.

Returns

A new instance of this type.

abstract static from_json_str(j: str) bobocep.bobocep.BoboJSONable
Parameters

j – A JSON str representation of an object of this type.

Returns

A new instance of this type.

property timestamp: int

Get event timestamp.

abstract to_json_dict() dict
Returns

A JSON dict representation of an object of this type.

abstract to_json_str() str
Returns

A JSON str representation of an object of this type.