Interface KeyManager
- All Known Implementing Classes:
AbstractKeyManager
,MinecraftKeyManager
,PluginKeyManager
public interface KeyManager
An interface for all
NamespacedKey
manager-
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.NamespacedKey
Create a newNamespacedKey
.default <Z> PluginKeyPair<Z>
createKeyPair
(String key, org.bukkit.persistence.PersistentDataType<?, Z> dataType) Create a new key pair with null default valuedefault <Z> PluginKeyPair<Z>
createKeyPair
(String key, org.bukkit.persistence.PersistentDataType<?, Z> dataType, Z defaultValue) Create a new key pair
-
Method Details
-
createKey
Create a newNamespacedKey
. This should have a function to store the createdNamespacedKey
for later uses.- Parameters:
key
- the key- Returns:
- the
NamespacedKey
-
createKeyPair
default <Z> PluginKeyPair<Z> createKeyPair(String key, org.bukkit.persistence.PersistentDataType<?, Z> dataType, Z defaultValue) Create a new key pair- Type Parameters:
Z
- the retrieved object type when applying this data type- Parameters:
key
- the keydataType
- the data type for the valuedefaultValue
- the default value if not found- Returns:
- the new key pair
-
createKeyPair
default <Z> PluginKeyPair<Z> createKeyPair(String key, org.bukkit.persistence.PersistentDataType<?, Z> dataType) Create a new key pair with null default value- Type Parameters:
Z
- the retrieved object type when applying this data type- Parameters:
key
- the keydataType
- the data type for the value- Returns:
- the new key pair
-