public final class NamespacedKey
extends java.lang.Object
Keys may only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes.
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
BUKKIT |
The namespace representing all keys generated by Bukkit for backwards
compatibility measures.
|
static java.lang.String |
MINECRAFT |
The namespace representing all inbuilt keys.
|
Constructor | Description |
---|---|
NamespacedKey(java.lang.String namespace,
java.lang.String key) |
Deprecated.
should never be used by plugins, for internal use only!!
|
NamespacedKey(Plugin plugin,
java.lang.String key) |
Create a key in the plugin's namespace.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object obj) |
|
java.lang.String |
getKey() |
|
java.lang.String |
getNamespace() |
|
int |
hashCode() |
|
static NamespacedKey |
minecraft(java.lang.String key) |
Get a key in the Minecraft namespace.
|
static NamespacedKey |
randomKey() |
Deprecated.
should never be used by plugins, for internal use only!!
|
java.lang.String |
toString() |
public static final java.lang.String MINECRAFT
public static final java.lang.String BUKKIT
@Deprecated public NamespacedKey(java.lang.String namespace, java.lang.String key)
namespace
- key
- public NamespacedKey(Plugin plugin, java.lang.String 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.
plugin
- the plugin to use for the namespacekey
- the key to createpublic java.lang.String getNamespace()
public java.lang.String getKey()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
@Deprecated public static NamespacedKey randomKey()
BUKKIT
namespace.public static NamespacedKey minecraft(java.lang.String key)
key
- the key to useCopyright © 2018. All rights reserved.