Class ConversationEventFactory
java.lang.Object
org.openhab.core.events.AbstractEventFactory
org.openhab.core.voice.text.conversation.events.ConversationEventFactory
- All Implemented Interfaces:
EventFactory
The
ConversationEventFactory defines a Event implementation that emits conversation changes.- Author:
- Miguel Álvarez Díez - Initial contribution, Florian Hotze - Differentiate between created, removed, message added and messages removed events
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openhab.core.events.AbstractEventFactory
AbstractEventFactory.ZonedDateTimeAdapter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConversationCreatedEventcreateConversationCreatedEvent(String conversationId, @Nullable String source) createConversationMessageAddedEvent(String conversationId, int messageId, ConversationRole role, String text, @Nullable String source) createConversationMessagesRemovedEvent(String conversationId, int removedSinceMessagesId, @Nullable String source) static ConversationRemovedEventcreateConversationRemovedEvent(String conversationId, @Nullable String source) protected EventcreateEventByType(String eventType, String topic, String payload, @Nullable String source) Create a new event instance based on the event type.Methods inherited from class org.openhab.core.events.AbstractEventFactory
checkNotNull, checkNotNullOrEmpty, createEvent, deserializePayload, getSupportedEventTypes, getTopicElements, serializePayload
-
Constructor Details
-
ConversationEventFactory
public ConversationEventFactory()Constructs a new ConversationEventFactory.
-
-
Method Details
-
createEventByType
protected Event createEventByType(String eventType, String topic, String payload, @Nullable String source) Description copied from class:AbstractEventFactoryCreate a new event instance based on the event type.- Specified by:
createEventByTypein classAbstractEventFactory- Parameters:
eventType- the event typetopic- the topicpayload- the payloadsource- the source, can be null- Returns:
- the created event instance
-
createConversationCreatedEvent
public static ConversationCreatedEvent createConversationCreatedEvent(String conversationId, @Nullable String source) -
createConversationRemovedEvent
public static ConversationRemovedEvent createConversationRemovedEvent(String conversationId, @Nullable String source) -
createConversationMessageAddedEvent
public static ConversationMessageAddedEvent createConversationMessageAddedEvent(String conversationId, int messageId, ConversationRole role, String text, @Nullable String source) -
createConversationMessagesRemovedEvent
public static ConversationMessagesRemovedEvent createConversationMessagesRemovedEvent(String conversationId, int removedSinceMessagesId, @Nullable String source)
-