Package org.openhab.core.events.system
Class SystemEventFactory
java.lang.Object
org.openhab.core.events.AbstractEventFactory
org.openhab.core.events.system.SystemEventFactory
- All Implemented Interfaces:
EventFactory
Factory that creates system events.
- Author:
- Kai Kreuzer - Initial contribution
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This is a java bean that is used to serialize/deserialize system event payload. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Event
createEventByType
(String eventType, String topic, String payload, @Nullable String source) Create a new event instance based on the event type.static StartlevelEvent
createStartlevelEvent
(Integer startlevel) Creates a trigger event from aType
.createStartlevelEvent
(String topic, String payload, @Nullable String source) Creates a startlevel event from a payload.Methods inherited from class org.openhab.core.events.AbstractEventFactory
checkNotNull, checkNotNullOrEmpty, createEvent, deserializePayload, getSupportedEventTypes, getTopicElements, serializePayload
-
Constructor Details
-
SystemEventFactory
public SystemEventFactory()
-
-
Method Details
-
createStartlevelEvent
Creates a trigger event from aType
.- Parameters:
startlevel
- Startlevel of system- Returns:
- Created start level event.
-
createEventByType
protected Event createEventByType(String eventType, String topic, String payload, @Nullable String source) throws Exception Description copied from class:AbstractEventFactory
Create a new event instance based on the event type.- Specified by:
createEventByType
in classAbstractEventFactory
- Parameters:
eventType
- the event typetopic
- the topicpayload
- the payloadsource
- the source, can be null- Returns:
- the created event instance
- Throws:
Exception
- if the creation of the event fails
-
createStartlevelEvent
Creates a startlevel event from a payload.- Parameters:
topic
- Event topicpayload
- Payloadsource
- Event source- Returns:
- created startlevel event
-