Interface StorageRepository
- All Known Implementing Classes:
ClientStorageRepository
,StorageRepositoryImpl
@API(status=STABLE,
since="2.0.0-milestone.1.2")
public interface StorageRepository
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a storage by ID, if it exists.Retrieves info for a given storage ID.void
Marks to be saved.void
Removes a storage by ID.removeIfEmpty
(UUID id) If the storage exists, and is empty, it will remove the storage from the repository.void
set
(UUID id, SerializableStorage storage) Sets a storage by ID.
-
Method Details
-
get
Retrieves a storage by ID, if it exists.- Parameters:
id
- the id- Returns:
- the storage, if present
-
set
Sets a storage by ID.- Parameters:
id
- the idstorage
- the storage
-
removeIfEmpty
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
Removes a storage by ID.- Parameters:
id
- the id
-
getInfo
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.
-