Package de.marcely.bedwars.tools
Interface PersistentStorage
- All Superinterfaces:
StringMapSerializationHelper
- All Known Subinterfaces:
ArenaPersistentStorage
Represents a String-Map object for attaching custom and persistent data to its holding object
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Classes implementing this, add the possibility of attaching custom and persistent data to it -
Method Summary
Modifier and TypeMethodDescriptiongetKeys()
Gets all the keys that exist within this storage.boolean
Removes everything we know about a given key-value pair.void
Forcefully save the storage.void
Set an entry to the internal map.Methods inherited from interface de.marcely.bedwars.tools.StringMapSerializationHelper
get, getBoolean, getDouble, getInt, getItemStack, getLong, set, set, set
-
Method Details
-
getKeys
Gets all the keys that exist within this storage.- Returns:
- All known keys
-
set
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 interfaceStringMapSerializationHelper
- Parameters:
key
- The key of the value with which you may identify the value later onvalue
- The value that you want to store- Throws:
IllegalArgumentException
- If the limitations aren't met
-
remove
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.
-