Interface PersistentStorage

All Superinterfaces:
StringMapSerializationHelper
All Known Subinterfaces:
ArenaPersistentStorage

public interface PersistentStorage extends StringMapSerializationHelper
Represents a String-Map object for attaching custom and persistent data to its holding object
  • Method Details

    • getKeys

      Set<String> getKeys()
      Gets all the keys that exist within this storage.
      Returns:
      All known keys
    • set

      void set(String key, String value)
      Set an entry to the internal map.

      It is not possible to have multiple entries with the same key. Existing ones automatically get replaced with this new one.

      Following limitations exist:
      - Key may not be longer than 255 characters
      - Key must only persist of the following characters: a-Z 0-9 ?!_-'#:@
      - Value may not be longer than 65534 characters

      Specified by:
      set in interface StringMapSerializationHelper
      Parameters:
      key - The key of the value with which you may identify the value later on
      value - The value that you want to store
      Throws:
      IllegalArgumentException - If the limitations aren't met
    • remove

      boolean remove(String key)
      Removes everything we know about a given key-value pair.
      Parameters:
      key - The key that we want to remove
      Returns:
      true if it has been found and removed
    • saveAsync

      void saveAsync()
      Forcefully save the storage.

      Depending on the implementation of the object holding the storage, it may also cause the holding object to be stored. The meaning of this method does not change because of that.