Class MemoryKey<T>

java.lang.Object
org.bukkit.entity.memory.MemoryKey<T>
Type Parameters:
T - the class type of the memory value
All Implemented Interfaces:
Keyed

public final class MemoryKey<T> extends Object implements Keyed
Represents a key used for accessing memory values of a LivingEntity.
  • Field Details

  • Method Details

    • getKey

      @NotNull public NamespacedKey getKey()
      Description copied from interface: Keyed
      Return the namespaced identifier for this object.
      Specified by:
      getKey in interface Keyed
      Returns:
      this object's key
    • getMemoryClass

      @NotNull public Class<T> getMemoryClass()
      Gets the class of values associated with this memory.
      Returns:
      the class of value objects
    • getByKey

      @Nullable public static MemoryKey getByKey(@NotNull NamespacedKey namespacedKey)
      Returns a MemoryKey by a NamespacedKey.
      Parameters:
      namespacedKey - the NamespacedKey referencing a MemoryKey
      Returns:
      the MemoryKey or null when no MemoryKey is available under that key
    • values

      @NotNull public static Set<MemoryKey> values()
      Returns the set of all MemoryKeys.
      Returns:
      the memoryKeys