Package net.minecraft.nbt
Record Class StringTag
java.lang.Object
java.lang.Record
net.minecraft.nbt.StringTag
- All Implemented Interfaces:
PrimitiveTag
,Tag
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final char
private static final StringTag
private static final char
private static final char
private static final int
private static final char
private final String
The field for thevalue
record component.Fields inherited from interface net.minecraft.nbt.Tag
ARRAY_HEADER, MAX_DEPTH, OBJECT_HEADER, OBJECT_REFERENCE, STRING_SIZE, TAG_BYTE, TAG_BYTE_ARRAY, TAG_COMPOUND, TAG_DOUBLE, TAG_END, TAG_FLOAT, TAG_INT, TAG_INT_ARRAY, TAG_LIST, TAG_LONG, TAG_LONG_ARRAY, TAG_SHORT, TAG_STRING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept
(StreamTagVisitor p_197566_) void
accept
(TagVisitor p_178154_) asString()
copy()
final boolean
Indicates whether some other object is "equal to" this one.byte
getId()
getType()
final int
hashCode()
Returns a hash code value for this object.static String
quoteAndEscape
(String p_129304_) static void
quoteAndEscape
(String p_410719_, StringBuilder p_409607_) int
static void
skipString
(DataInput p_197564_) toString()
Returns a string representation of this record class.value()
Returns the value of thevalue
record component.static StringTag
void
write
(DataOutput p_129296_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.nbt.Tag
acceptAsRoot, asBoolean, asByte, asByteArray, asCompound, asDouble, asFloat, asInt, asIntArray, asList, asLong, asLongArray, asNumber, asShort
-
Field Details
-
value
The field for thevalue
record component. -
SELF_SIZE_IN_BYTES
private static final int SELF_SIZE_IN_BYTES- See Also:
-
TYPE
-
EMPTY
-
DOUBLE_QUOTE
private static final char DOUBLE_QUOTE- See Also:
-
SINGLE_QUOTE
private static final char SINGLE_QUOTE- See Also:
-
ESCAPE
private static final char ESCAPE- See Also:
-
NOT_SET
private static final char NOT_SET- See Also:
-
-
Constructor Details
-
StringTag
Deprecated, for removal: This API element is subject to removal in a future version.Creates an instance of aStringTag
record class.- Parameters:
value
- the value for thevalue
record component
-
-
Method Details
-
skipString
- Throws:
IOException
-
valueOf
-
write
- Specified by:
write
in interfaceTag
- Throws:
IOException
-
sizeInBytes
public int sizeInBytes()- Specified by:
sizeInBytes
in interfaceTag
-
getId
public byte getId() -
getType
-
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. -
copy
- Specified by:
copy
in interfacePrimitiveTag
- Specified by:
copy
in interfaceTag
-
asString
-
accept
-
quoteAndEscape
-
quoteAndEscape
-
accept
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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)
. -
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-