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 charprivate static final StringTagprivate static final charprivate static final charprivate static final intprivate static final charprivate final StringThe field for thevaluerecord 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 pVisitor) voidaccept(TagVisitor pVisitor) asString()copy()final booleanIndicates whether some other object is "equal to" this one.static StringescapeWithoutQuotes(String pInput) static voidescapeWithoutQuotes(String pInput, StringBuilder pStringBuilder) bytegetId()getType()final inthashCode()Returns a hash code value for this object.static StringquoteAndEscape(String pText) static voidquoteAndEscape(String pText, StringBuilder pStringBuilder) intstatic voidskipString(DataInput pInput) toString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.static StringTagvoidwrite(DataOutput pOutput) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 thevaluerecord 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 aStringTagrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
skipString
- Throws:
IOException
-
valueOf
-
write
- Specified by:
writein interfaceTag- Throws:
IOException
-
sizeInBytes
public int sizeInBytes()- Specified by:
sizeInBytesin 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:
copyin interfacePrimitiveTag- Specified by:
copyin interfaceTag
-
asString
-
accept
-
quoteAndEscape
-
quoteAndEscape
-
escapeWithoutQuotes
-
escapeWithoutQuotes
-
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 thevaluerecord component.- Returns:
- the value of the
valuerecord component
-