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
ConstructorsConstructorDescriptionNamespaceID(@NotNull String domain, @NotNull String path) Creates an instance of aNamespaceIDrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull StringasString()charcharAt(int index) @NotNull Stringdomain()Returns the value of thedomainrecord component.booleanIndicates whether some other object is "equal to" this one.static @NotNull NamespaceIDstatic @NotNull NamespaceIDstatic @NotNull NamespaceIDfrom(@NotNull net.kyori.adventure.key.Key key) inthashCode()Returns a hash code value for this object.intlength()@NotNull String@NotNull Stringpath()Returns the value of thepathrecord component.@NotNull CharSequencesubSequence(int start, int end) @NotNull StringtoString()Returns a string representation of this record class.@NotNull Stringvalue()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints, isEmptyMethods inherited from interface net.kyori.examination.Examinable
examinableName, examineMethods inherited from interface net.kyori.adventure.key.Key
asMinimalString, compareTo, examinableProperties, key
-
Constructor Details
-
NamespaceID
Creates an instance of aNamespaceIDrecord class.- Parameters:
domain- the value for thedomainrecord componentpath- the value for thepathrecord 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:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
namespace
- Specified by:
namespacein interfacenet.kyori.adventure.key.Key- Specified by:
namespacein interfacenet.kyori.adventure.key.Namespaced
-
value
- Specified by:
valuein interfacenet.kyori.adventure.key.Key
-
asString
- Specified by:
asStringin 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:
toStringin interfaceCharSequence- Specified by:
toStringin 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 thedomainrecord component.- Returns:
- the value of the
domainrecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-