Package org.bukkit
Class NamespacedKey
java.lang.Object
org.bukkit.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 Summary
-
Constructor Summary
Constructors Constructor Description NamespacedKey(String namespace, String key)Deprecated.should never be used by plugins, for internal use only!!NamespacedKey(Plugin plugin, String key)Create a key in the plugin's namespace. -
Method Summary
Modifier and Type Method Description booleanequals(Object obj)StringgetKey()StringgetNamespace()inthashCode()static NamespacedKeyminecraft(String key)Get a key in the Minecraft namespace.static NamespacedKeyrandomKey()Deprecated.should never be used by plugins, for internal use only!!StringtoString()
-
Field Details
-
MINECRAFT
The namespace representing all inbuilt keys.- See Also:
- Constant Field Values
-
BUKKIT
The namespace representing all keys generated by Bukkit for backwards compatibility measures.- See Also:
- Constant Field Values
-
-
Constructor Details
-
NamespacedKey
Deprecated.should never be used by plugins, for internal use only!!Create a key in a specific namespace.- Parameters:
namespace- namespacekey- key
-
NamespacedKey
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 namespacekey- the key to create
-
-
Method Details
-
getNamespace
-
getKey
-
hashCode
public int hashCode() -
equals
-
toString
-
randomKey
Deprecated.should never be used by plugins, for internal use only!!Return a new random key in theBUKKITnamespace.- Returns:
- new key
-
minecraft
Get a key in the Minecraft namespace.- Parameters:
key- the key to use- Returns:
- new key in the Minecraft namespace
-