Interface TypedKey<T>

Type Parameters:
T - the value type for the registry
All Superinterfaces:
net.kyori.adventure.key.Keyed

@Experimental public sealed interface TypedKey<T> extends net.kyori.adventure.key.Keyed
Represents a key for a value in a specific registry.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends net.kyori.adventure.key.Keyed>
    @NotNull TypedKey<T>
    create(@NotNull RegistryKey<T> registryKey, @NotNull net.kyori.adventure.key.Key key)
    Create a typed key from a key and a registry key.
    @NotNull net.kyori.adventure.key.Key
    key()
    Gets the key for the value in the registry.
    Gets the registry key for the value this key represents.
  • Method Details

    • key

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

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

      @Experimental @NotNull static <T extends net.kyori.adventure.key.Keyed> @NotNull TypedKey<T> create(@NotNull @NotNull RegistryKey<T> registryKey, @NotNull @NotNull net.kyori.adventure.key.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