Interface TypedKey<T>

Type Parameters:
T - the value type for the registry
All Superinterfaces:
Comparable<Key>, net.kyori.examination.Examinable, Key, Keyed, Namespaced

@Experimental @NullMarked public sealed interface TypedKey<T> extends Key
Represents a key for a value in a specific registry.
  • Method Details

    • key

      Key key()
      Gets the key for the value in the registry.
      Specified by:
      key in interface Key
      Specified by:
      key in interface Keyed
      Returns:
      the value's key
    • registryKey

      RegistryKey<T> registryKey()
      Gets the registry key for the value this key represents.
      Returns:
      the registry key
    • create

      @Experimental static <T> TypedKey<T> create(RegistryKey<T> registryKey, Key key)
      Create a typed key from a key and a registry key.
      Type Parameters:
      T - value type
      Parameters:
      registryKey - the registry this key is for
      key - the key for the value in the registry
      Returns:
      a new key for the value key and registry key