public class Identifier
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_NAMESPACE |
static java.lang.String |
VALID_KEY_CHARS |
static java.lang.String |
VALID_VALUE_CHARS |
| Modifier and Type | Method and Description |
|---|---|
static Identifier |
defaultNamespace(java.lang.String value)
Create a new identifier with the default namespace
"minecraft". |
boolean |
equals(java.lang.String key,
java.lang.String value)
Check if the key and value are equal to the given key and value.
|
java.lang.String |
get() |
java.lang.String |
getKey() |
java.lang.String |
getValue() |
static Identifier |
of(java.lang.String value)
Create a new identifier.
If value contains a colon, it will be split into namespace and value.If value does not contain a colon, namespace will be set to "minecraft". |
static Identifier |
of(java.lang.String key,
java.lang.String value)
Create a new identifier from key and value.
|
static java.lang.String |
stripDefaultNamespace(Identifier id) |
java.lang.String |
toString() |
static Identifier |
tryOf(java.lang.String value)
Try to create a new identifier.
If value contains a colon, it will be split into namespace and value.If value does not contain a colon, namespace will be set to "minecraft". |
public static final java.lang.String DEFAULT_NAMESPACE
public static final java.lang.String VALID_KEY_CHARS
public static final java.lang.String VALID_VALUE_CHARS
public static Identifier defaultNamespace(java.lang.String value)
"minecraft".value - The value of the identifierpublic static Identifier of(java.lang.String value)
value contains a colon, it will be split into namespace and value.value does not contain a colon, namespace will be set to "minecraft".value - The value of the identifierjava.lang.IllegalArgumentException - If the value is not a valid identifierpublic static Identifier tryOf(java.lang.String value)
value contains a colon, it will be split into namespace and value.value does not contain a colon, namespace will be set to "minecraft".value - The value of the identifierpublic static Identifier of(java.lang.String key, java.lang.String value)
key - The key of the identifiervalue - The value of the identifierjava.lang.IllegalArgumentException - If the key or value is not validpublic static java.lang.String stripDefaultNamespace(Identifier id)
public java.lang.String get()
public java.lang.String getKey()
public java.lang.String getValue()
public boolean equals(java.lang.String key,
java.lang.String value)
key - The key to checkvalue - The value to checkpublic java.lang.String toString()
toString in class java.lang.Object