Package com.viaversion.viaversion.util
Class Key
java.lang.Object
com.viaversion.viaversion.util.Key
-
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal booleanstatic booleaninthashCode()booleanstatic booleanReturns the identifier in a minimized form.static Stringstatic Stringnamespaced(String identifier) static KeyCreates a new key from the given identifier string, with or without an explicit namespace.static KeyCreates a new key with the given namespace and path.static KeyCreates 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 StringstripMinecraftNamespace(String identifier) static StringstripNamespace(String identifier) toString()static @Nullable KeyTries 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
-