Package net.minestom.server.utils
Record Class NamespaceID
java.lang.Object
java.lang.Record
net.minestom.server.utils.NamespaceID
- All Implemented Interfaces:
CharSequence
,Comparable<net.kyori.adventure.key.Key>
,net.kyori.adventure.key.Key
,net.kyori.adventure.key.Keyed
,net.kyori.adventure.key.Namespaced
,net.kyori.examination.Examinable
public record NamespaceID(@NotNull String domain, @NotNull String path)
extends Record
implements CharSequence, net.kyori.adventure.key.Key
Represents a namespaced ID
https://minecraft.wiki/w/Namespaced_ID
-
Field Summary
Fields inherited from interface net.kyori.adventure.key.Key
DEFAULT_SEPARATOR, MINECRAFT_NAMESPACE
-
Constructor Summary
ConstructorDescriptionNamespaceID
(@NotNull String domain, @NotNull String path) Creates an instance of aNamespaceID
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull String
asString()
char
charAt
(int index) @NotNull String
domain()
Returns the value of thedomain
record component.boolean
Indicates whether some other object is "equal to" this one.static @NotNull NamespaceID
static @NotNull NamespaceID
static @NotNull NamespaceID
from
(@NotNull net.kyori.adventure.key.Key key) int
hashCode()
Returns a hash code value for this object.int
length()
@NotNull String
@NotNull String
path()
Returns the value of thepath
record component.@NotNull CharSequence
subSequence
(int start, int end) @NotNull String
toString()
Returns a string representation of this record class.@NotNull String
value()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
Methods inherited from interface net.kyori.examination.Examinable
examinableName, examine
Methods inherited from interface net.kyori.adventure.key.Key
asMinimalString, compareTo, examinableProperties, key
-
Constructor Details
-
NamespaceID
Creates an instance of aNamespaceID
record class.- Parameters:
domain
- the value for thedomain
record componentpath
- the value for thepath
record component
-
-
Method Details
-
from
-
from
@NotNull public static @NotNull NamespaceID from(@NotNull @NotNull String domain, @NotNull @NotNull String path) -
from
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
namespace
- Specified by:
namespace
in interfacenet.kyori.adventure.key.Key
- Specified by:
namespace
in interfacenet.kyori.adventure.key.Namespaced
-
value
- Specified by:
value
in interfacenet.kyori.adventure.key.Key
-
asString
- Specified by:
asString
in interfacenet.kyori.adventure.key.Key
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.- Specified by:
toString
in interfaceCharSequence
- Specified by:
toString
in classRecord
- Returns:
- a string representation of this object
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
domain
Returns the value of thedomain
record component.- Returns:
- the value of the
domain
record component
-
path
Returns the value of thepath
record component.- Returns:
- the value of the
path
record component
-