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:
  • Field Details

  • Constructor Details

    • MessageChangeEvent

      public MessageChangeEvent(AiChat<T> source, boolean fromClient, T message, MessageChangeEvent.ChangeType changeType)
      Creates the event.
      Parameters:
      source - the chat
      fromClient - whether the change originated on the client
      message - the affected message
      changeType - the kind of change
  • Method Details

    • getMessage

      public T getMessage()
      Gets the affected message.
      Returns:
      the message
    • getChangeType

      public MessageChangeEvent.ChangeType getChangeType()
      Gets the kind of change.
      Returns:
      the change type