Package com.viaversion.viaversion.util
Class Key
java.lang.Object
com.viaversion.viaversion.util.Key
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
final boolean
static boolean
int
hashCode()
boolean
static boolean
Returns the identifier in a minimized form.static String
static String
namespaced
(String identifier) static Key
Creates a new key from the given identifier string, with or without an explicit namespace.static Key
Creates a new key with the given namespace and path.static Key
Creates a new key with the given path and the default namespace "minecraft".original()
Returns the unmodified original identifier, possbily without an explicit namespace.path()
static String
stripMinecraftNamespace
(String identifier) static String
stripNamespace
(String identifier) toString()
static @Nullable Key
Tries to create a new key from the given identifier string, with or without an explicit namespace.withNamespace
(String namespace)
-
Method Details
-
of
Creates a new key with the given namespace and path.- Parameters:
namespace
- the namespace of the identifierpath
- the path of the identifier- Returns:
- a new key with the given namespace and path
-
ofPath
Creates a new key with the given path and the default namespace "minecraft".- Parameters:
path
- the path of the identifier- Returns:
- a new key with the given path and the default namespace
-
of
Creates a new key from the given identifier string, with or without an explicit namespace.- Parameters:
identifier
- the identifier string- Returns:
- a new key with the given identifier
-
tryParse
Tries to create a new key from the given identifier string, with or without an explicit namespace.- Parameters:
identifier
- the identifier string- Returns:
- a new key with the given identifier, or null if the identifier is invalid
-
stripNamespace
-
namespace
-
stripMinecraftNamespace
-
equals
-
namespaced
-
isValid
-
namespace
-
path
-
original
Returns the unmodified original identifier, possbily without an explicit namespace.- Returns:
- the original identifier, possibly without an explicit namespace
-
minimized
Returns the identifier in a minimized form. If the namespace is "minecraft", it will return just the path.- Returns:
- the identifier in a minimized form
-
hasMinecraftNamespace
public boolean hasMinecraftNamespace() -
withNamespace
-
withPath
-
equals
-
equals
-
hashCode
public int hashCode() -
toString
-