public class Identifier
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
VALID_KEY_CHARS |
static java.lang.String |
VALID_VALUE_CHARS |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
get() |
java.lang.String |
getKey() |
java.lang.String |
getValue() |
int |
hashCode() |
static Identifier |
of(java.lang.String value)
Create a new identifier.
|
static Identifier |
of(java.lang.String key,
java.lang.String value)
Create a new identifier from key and value.
|
java.lang.String |
toString() |
static Identifier |
tryOf(java.lang.String value)
Try to create a new identifier.
|
public static final java.lang.String VALID_KEY_CHARS
public static final java.lang.String VALID_VALUE_CHARS
public 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 java.lang.String get()
public java.lang.String getKey()
public java.lang.String getValue()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object