Interface KeyManager

All Known Implementing Classes:
AbstractKeyManager, MinecraftKeyManager, PluginKeyManager

public interface KeyManager
An interface for all NamespacedKey manager
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.NamespacedKey
    Create a new NamespacedKey.
    default <Z> PluginKeyPair<Z>
    createKeyPair(String key, org.bukkit.persistence.PersistentDataType<?,Z> dataType)
    Create a new key pair with null default value
    default <Z> PluginKeyPair<Z>
    createKeyPair(String key, org.bukkit.persistence.PersistentDataType<?,Z> dataType, Z defaultValue)
    Create a new key pair
  • Method Details

    • createKey

      org.bukkit.NamespacedKey createKey(String key)
      Create a new NamespacedKey. This should have a function to store the created NamespacedKey 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 key
      dataType - the data type for the value
      defaultValue - 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 key
      dataType - the data type for the value
      Returns:
      the new key pair