Class PluginKeyPair<Z>

java.lang.Object
io.github.projectunified.minelib.util.key.PluginKeyPair<Z>
Type Parameters:
Z - the retrieved object type when applying this data type

public class PluginKeyPair<Z> extends Object
A pair of NamespacedKey and PersistentDataType
  • Constructor Summary

    Constructors
    Constructor
    Description
    PluginKeyPair(org.bukkit.NamespacedKey key, org.bukkit.persistence.PersistentDataType<?,Z> dataType, Z defaultValue)
    Create a new instance of PluginKeyPair
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(org.bukkit.persistence.PersistentDataContainer container)
    Check if the container contains the key
    boolean
    contains(org.bukkit.persistence.PersistentDataHolder holder)
    Check if the holder contains the key
    void
    copy(org.bukkit.persistence.PersistentDataContainer fromContainer, org.bukkit.persistence.PersistentDataContainer toContainer)
    Copy the value from the source container to the target container
    void
    copy(org.bukkit.persistence.PersistentDataHolder fromHolder, org.bukkit.persistence.PersistentDataHolder toHolder)
    Copy the value from the source holder to the target holder
    get(org.bukkit.persistence.PersistentDataContainer container)
    Get the value from the container
    get(org.bukkit.persistence.PersistentDataHolder holder)
    Get the value from the holder
    org.bukkit.persistence.PersistentDataType<?,Z>
    Get the data type
    Get the default value
    org.bukkit.NamespacedKey
    Get the key
    void
    remove(org.bukkit.persistence.PersistentDataContainer container)
    Remove the value from the container
    void
    remove(org.bukkit.persistence.PersistentDataHolder holder)
    Remove the value from the holder
    void
    set(org.bukkit.persistence.PersistentDataContainer container, Z value)
    Set the value to the container
    void
    set(org.bukkit.persistence.PersistentDataHolder holder, Z value)
    Set the value to the holder

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PluginKeyPair

      public PluginKeyPair(org.bukkit.NamespacedKey key, org.bukkit.persistence.PersistentDataType<?,Z> dataType, Z defaultValue)
      Create a new instance of PluginKeyPair
      Parameters:
      key - the key
      dataType - the data type
      defaultValue - the default value
  • Method Details

    • getKey

      public org.bukkit.NamespacedKey getKey()
      Get the key
      Returns:
      the key
    • getDataType

      public org.bukkit.persistence.PersistentDataType<?,Z> getDataType()
      Get the data type
      Returns:
      the data type
    • getDefaultValue

      public Z getDefaultValue()
      Get the default value
      Returns:
      the default value
    • get

      public Z get(org.bukkit.persistence.PersistentDataContainer container)
      Get the value from the container
      Parameters:
      container - the container
      Returns:
      the value
    • set

      public void set(org.bukkit.persistence.PersistentDataContainer container, Z value)
      Set the value to the container
      Parameters:
      container - the container
      value - the value
    • get

      public Z get(org.bukkit.persistence.PersistentDataHolder holder)
      Get the value from the holder
      Parameters:
      holder - the holder
      Returns:
      the value
    • set

      public void set(org.bukkit.persistence.PersistentDataHolder holder, Z value)
      Set the value to the holder
      Parameters:
      holder - the holder
      value - the value
    • contains

      public boolean contains(org.bukkit.persistence.PersistentDataContainer container)
      Check if the container contains the key
      Parameters:
      container - the container
    • contains

      public boolean contains(org.bukkit.persistence.PersistentDataHolder holder)
      Check if the holder contains the key
      Parameters:
      holder - the holder
    • copy

      public void copy(org.bukkit.persistence.PersistentDataContainer fromContainer, org.bukkit.persistence.PersistentDataContainer toContainer)
      Copy the value from the source container to the target container
      Parameters:
      fromContainer - the source container
      toContainer - the target container
    • copy

      public void copy(org.bukkit.persistence.PersistentDataHolder fromHolder, org.bukkit.persistence.PersistentDataHolder toHolder)
      Copy the value from the source holder to the target holder
      Parameters:
      fromHolder - the source holder
      toHolder - the target holder
    • remove

      public void remove(org.bukkit.persistence.PersistentDataContainer container)
      Remove the value from the container
      Parameters:
      container - the container
    • remove

      public void remove(org.bukkit.persistence.PersistentDataHolder holder)
      Remove the value from the holder
      Parameters:
      holder - the holder