Class InboxEventFactory

java.lang.Object
org.openhab.core.events.AbstractEventFactory
org.openhab.core.config.discovery.inbox.events.InboxEventFactory
All Implemented Interfaces:
EventFactory

@NonNullByDefault public class InboxEventFactory extends AbstractEventFactory
An InboxEventFactory is responsible for creating inbox event instances.
Author:
Stefan Bußweiler - Initial contribution
  • Constructor Details

    • InboxEventFactory

      public InboxEventFactory()
      Constructs a new InboxEventFactory.
  • Method Details

    • 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
    • createAddedEvent

      public static InboxAddedEvent createAddedEvent(DiscoveryResult discoveryResult)
      Creates an inbox added event.
      Parameters:
      discoveryResult - the discovery result
      Returns:
      the created inbox added event
      Throws:
      IllegalArgumentException - if discoveryResult is null
    • createRemovedEvent

      public static InboxRemovedEvent createRemovedEvent(DiscoveryResult discoveryResult)
      Creates an inbox removed event.
      Parameters:
      discoveryResult - the discovery result
      Returns:
      the created inbox removed event
      Throws:
      IllegalArgumentException - if discoveryResult is null
    • createUpdatedEvent

      public static InboxUpdatedEvent createUpdatedEvent(DiscoveryResult discoveryResult)
      Creates an inbox updated event.
      Parameters:
      discoveryResult - the discovery result
      Returns:
      the created inbox updated event
      Throws:
      IllegalArgumentException - if discoveryResult is null