Package org.bukkit

Class NamespacedKey


  • public final class NamespacedKey
    extends Object
    Represents a String based key which consists of two components - a namespace and a key. Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens.

    Keys may only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes.

    • Field Detail

      • BUKKIT

        public static final String BUKKIT
        The namespace representing all keys generated by Bukkit for backwards compatibility measures.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NamespacedKey

        @Deprecated
        public NamespacedKey​(@NotNull
                             String namespace,
                             @NotNull
                             String key)
        Deprecated.
        should never be used by plugins, for internal use only!!
        Create a key in a specific namespace.
        Parameters:
        namespace - namespace
        key - key
      • NamespacedKey

        public NamespacedKey​(@NotNull
                             Plugin plugin,
                             @NotNull
                             String key)
        Create a key in the plugin's namespace.

        Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens.

        Keys may only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes.

        Parameters:
        plugin - the plugin to use for the namespace
        key - the key to create