Interface StorageRepository

All Known Implementing Classes:
ClientStorageRepository, StorageRepositoryImpl

@API(status=STABLE, since="2.0.0-milestone.1.2") public interface StorageRepository
  • Method Details

    • get

      Retrieves a storage by ID, if it exists.
      Parameters:
      id - the id
      Returns:
      the storage, if present
    • set

      void set(UUID id, SerializableStorage storage)
      Sets a storage by ID.
      Parameters:
      id - the id
      storage - the storage
    • removeIfEmpty

      Optional<SerializableStorage> removeIfEmpty(UUID id)
      If the storage exists, and is empty, it will remove the storage from the repository.
      Parameters:
      id - the id
      Returns:
      the removed storage, if it existed and was empty
    • remove

      void remove(UUID id)
      Removes a storage by ID.
      Parameters:
      id - the id
    • getInfo

      StorageInfo getInfo(UUID id)
      Retrieves info for a given storage ID.
      Parameters:
      id - the id
      Returns:
      the info, or StorageInfo.UNKNOWN if the ID was not found
    • markAsChanged

      void markAsChanged()
      Marks to be saved.