Package com.destroystokyo.paper
Class NamespacedTag
java.lang.Object
com.destroystokyo.paper.NamespacedTag
- All Implemented Interfaces:
Namespaced
Represents a String based key pertaining to a tagged entry. 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
ConstructorDescriptionNamespacedTag(@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. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getKey()
Gets the key corresponding to this resourceGets the namespace this resource is a part ofint
hashCode()
static @NotNull NamespacedTag
Get a key in the Minecraft namespace.static NamespacedTag
Deprecated.should never be used by plugins, for internal use only!!toString()
-
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
-
NamespacedTag
Deprecated.should never be used by plugins, for internal use only!!Create a key in a specific namespace.- Parameters:
namespace
- String representing a grouping of keyskey
- Name for this specific key
-
NamespacedTag
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
Description copied from interface:Namespaced
Gets the namespace this resource is a part ofThis is contractually obligated to only contain lowercase alphanumeric characters, periods, underscores, and hyphens.
- Specified by:
getNamespace
in interfaceNamespaced
- Returns:
- resource namespace
-
getKey
Description copied from interface:Namespaced
Gets the key corresponding to this resourceThis is contractually obligated to only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes.
- Specified by:
getKey
in interfaceNamespaced
- Returns:
- resource key
-
hashCode
public int hashCode() -
equals
-
toString
-
randomKey
Deprecated.should never be used by plugins, for internal use only!!Return a new random key in theBUKKIT
namespace.- Returns:
- new key
-
minecraft
Get a key in the Minecraft namespace.- Parameters:
key
- the key to use- Returns:
- new key in the Minecraft namespace
-