Class InboxEventFactory
java.lang.Object
org.openhab.core.events.AbstractEventFactory
org.openhab.core.config.discovery.inbox.events.InboxEventFactory
- All Implemented Interfaces:
EventFactory
An
InboxEventFactory
is responsible for creating inbox event instances.- Author:
- Stefan Bußweiler - Initial contribution
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openhab.core.events.AbstractEventFactory
AbstractEventFactory.ZonedDateTimeAdapter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InboxAddedEvent
createAddedEvent
(DiscoveryResult discoveryResult) Creates an inbox added event.protected Event
createEventByType
(String eventType, String topic, String payload, @Nullable String source) Create a new event instance based on the event type.static InboxRemovedEvent
createRemovedEvent
(DiscoveryResult discoveryResult) Creates an inbox removed event.static InboxUpdatedEvent
createUpdatedEvent
(DiscoveryResult discoveryResult) Creates an inbox updated event.Methods inherited from class org.openhab.core.events.AbstractEventFactory
checkNotNull, checkNotNullOrEmpty, createEvent, deserializePayload, getSupportedEventTypes, getTopicElements, serializePayload
-
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 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
-
createAddedEvent
Creates an inbox added event.- Parameters:
discoveryResult
- the discovery result- Returns:
- the created inbox added event
- Throws:
IllegalArgumentException
- if discoveryResult is null
-
createRemovedEvent
Creates an inbox removed event.- Parameters:
discoveryResult
- the discovery result- Returns:
- the created inbox removed event
- Throws:
IllegalArgumentException
- if discoveryResult is null
-
createUpdatedEvent
Creates an inbox updated event.- Parameters:
discoveryResult
- the discovery result- Returns:
- the created inbox updated event
- Throws:
IllegalArgumentException
- if discoveryResult is null
-