Package io.jmix.aichat.component.chat
Class MessageChangeEvent<T extends AiChatMessage>
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<AiChat<T>>
io.jmix.aichat.component.chat.MessageChangeEvent<T>
- Type Parameters:
T- the message type
- All Implemented Interfaces:
Serializable
public class MessageChangeEvent<T extends AiChatMessage>
extends com.vaadin.flow.component.ComponentEvent<AiChat<T>>
Fired when a message is committed to (
MessageChangeEvent.ChangeType.ADDED) or removed
from (MessageChangeEvent.ChangeType.REMOVED) the conversation. A notification of that
commit or removal, not the persistence hook itself: that is
AiChat.setSaveDelegate(java.util.function.Function<T, T>), AiChat#setRemoveDelegate or the
autoSave attribute.- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionMessageChangeEvent(AiChat<T> source, boolean fromClient, T message, MessageChangeEvent.ChangeType changeType) Creates the event. -
Method Summary
Modifier and TypeMethodDescriptionGets the kind of change.Gets the affected message.Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, getUI, isFromClient, unregisterListenerMethods inherited from class java.util.EventObject
toString
-
Field Details
-
message
-
changeType
-
-
Constructor Details
-
MessageChangeEvent
public MessageChangeEvent(AiChat<T> source, boolean fromClient, T message, MessageChangeEvent.ChangeType changeType) Creates the event.- Parameters:
source- the chatfromClient- whether the change originated on the clientmessage- the affected messagechangeType- the kind of change
-
-
Method Details
-
getMessage
Gets the affected message.- Returns:
- the message
-
getChangeType
Gets the kind of change.- Returns:
- the change type
-