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.voidMarks to be saved.voidRemoves a storage by ID.removeIfEmpty(UUID id) If the storage exists, and is empty, it will remove the storage from the repository.voidset(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.UNKNOWNif the ID was not found
-
markAsChanged
void markAsChanged()Marks to be saved.
-