Interface IMemoryMessageHistory

All Known Implementing Classes:
MemoryMessageHistory

public interface IMemoryMessageHistory
Interface for managing chat message history in memory. Provides methods for clearing, checking, loading, and saving chat message history. Implementations of this interface interact with a persistence mechanism to store and retrieve MessageHistory objects.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Key used for storing and retrieving the message history in the persistence layer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears the stored chat message history from memory.
    Checks if the stored chat message history is empty.
    Loads the chat message history from memory.
    void
    save(MessageHistory messageHistory)
    Saves the given MessageHistory object to memory.
  • Field Details

    • KEY

      static final String KEY
      Key used for storing and retrieving the message history in the persistence layer.
      See Also:
  • Method Details

    • clear

      void clear()
      Clears the stored chat message history from memory. Deletes the data associated with the key KEY in the persistence mechanism.
    • isEmpty

      Boolean isEmpty()
      Checks if the stored chat message history is empty.
      Returns:
      true if the stored message history is empty or null; false otherwise.
    • load

      Loads the chat message history from memory.
      Returns:
      the MessageHistory object, or null if deserialization fails or no data is found.
    • save

      void save(MessageHistory messageHistory)
      Saves the given MessageHistory object to memory.
      Parameters:
      messageHistory - the MessageHistory object to save.