Class CoreMemory

java.lang.Object
me.zacharias.chat.core.memory.CoreMemory

public class CoreMemory extends Object
CoreMemory is a class that provides a way to store and retrieve strings from a file.
This is meant to be used as a way to store and retrieve strings from a file.
  • Constructor Details

    • CoreMemory

      public CoreMemory(String memoryFile)
      Creates a new instance of CoreMemory.
      Parameters:
      memoryFile - The file to store the memory in
  • Method Details

    • getInstance

      public static CoreMemory getInstance()
      Gets the singleton instance of CoreMemory.
      Returns:
      The singleton instance of CoreMemory
    • getMemoriesIdentity

      public String[] getMemoriesIdentity()
      Gets the memory.
      Returns:
      A list of memory identifies/names
    • getMemory

      public String getMemory(String name)
    • addMemory

      public void addMemory(String name, String memory)
      Sets the memory.
      Parameters:
      name - The name/identity of the memory
      memory - The memory
    • removeMemory

      public void removeMemory(String name)
      Removes the memory.
      Parameters:
      name - The memory to remove
    • getMemories

      public String getMemories()
      Gets all memories as a JSON string.
      Returns:
      A JSON string of all memories
    • getMemoriesArray

      public ArrayList<String> getMemoriesArray()