Namespaced
public final class NamespacedTag extends Object implements Namespaced
Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens.
Keys may only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes.
Modifier and Type | Field | Description |
---|---|---|
static String |
BUKKIT |
The namespace representing all keys generated by Bukkit for backwards
compatibility measures.
|
static String |
MINECRAFT |
The namespace representing all inbuilt keys.
|
Constructor | Description |
---|---|
NamespacedTag(@NotNull String namespace,
@NotNull String key) |
Deprecated.
should never be used by plugins, for internal use only!!
|
NamespacedTag(@NotNull Plugin plugin,
@NotNull String key) |
Create a key in the plugin's namespace.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object obj) |
|
@NotNull String |
getKey() |
Gets the key corresponding to this resource
|
@NotNull String |
getNamespace() |
Gets the namespace this resource is a part of
|
int |
hashCode() |
|
static @NotNull NamespacedTag |
minecraft(@NotNull String key) |
Get a key in the Minecraft namespace.
|
static NamespacedTag |
randomKey() |
Deprecated.
should never be used by plugins, for internal use only!!
|
String |
toString() |
public static final String MINECRAFT
public static final String BUKKIT
@Deprecated public NamespacedTag(@NotNull @NotNull String namespace, @NotNull @NotNull String key)
namespace
- String representing a grouping of keyskey
- Name for this specific keypublic NamespacedTag(@NotNull @NotNull Plugin plugin, @NotNull @NotNull 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 create@NotNull public @NotNull String getNamespace()
Namespaced
This is contractually obligated to only contain lowercase alphanumeric characters, periods, underscores, and hyphens.
getNamespace
in interface Namespaced
@NotNull public @NotNull String getKey()
Namespaced
This is contractually obligated to only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes.
getKey
in interface Namespaced
@Deprecated public static NamespacedTag randomKey()
BUKKIT
namespace.@NotNull public static @NotNull NamespacedTag minecraft(@NotNull @NotNull String key)
key
- the key to useCopyright © 2020. All rights reserved.