Class SystemEventFactory

java.lang.Object
org.openhab.core.events.AbstractEventFactory
org.openhab.core.events.system.SystemEventFactory
All Implemented Interfaces:
EventFactory

@NonNullByDefault public class SystemEventFactory extends AbstractEventFactory
Factory that creates system events.
Author:
Kai Kreuzer - Initial contribution
  • Constructor Details

    • SystemEventFactory

      public SystemEventFactory()
  • Method Details

    • createStartlevelEvent

      public static StartlevelEvent createStartlevelEvent(Integer startlevel)
      Creates a trigger event from a Type.
      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 class AbstractEventFactory
      Parameters:
      eventType - the event type
      topic - the topic
      payload - the payload
      source - the source, can be null
      Returns:
      the created event instance
      Throws:
      Exception - if the creation of the event fails
    • createStartlevelEvent

      public StartlevelEvent createStartlevelEvent(String topic, String payload, @Nullable String source)
      Creates a startlevel event from a payload.
      Parameters:
      topic - Event topic
      payload - Payload
      source - Event source
      Returns:
      created startlevel event