Package net.minecraft.text
Record Class LiteralTextContent
java.lang.Object
java.lang.Record
net.minecraft.text.LiteralTextContent
- Record Components:
- string-
- All Implemented Interfaces:
- TextContent
- Mappings:
- Namespace - Name - official - ub- intermediary - net/minecraft/class_2585- named - net/minecraft/text/LiteralTextContent- official - b- intermediary - comp_737- named - string
- 
Field SummaryFieldsFields inherited from interface net.minecraft.text.TextContentEMPTY
- 
Constructor SummaryConstructorsConstructorDescriptionLiteralTextContent(String string) Creates an instance of aLiteralTextContentrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.string()Returns the value of thestringrecord component.toString()Returns a string representation of this record class.<T> Optional<T>visit(StringVisitable.StyledVisitor<T> visitor, Style style) Visits this content.<T> Optional<T>visit(StringVisitable.Visitor<T> visitor) Visits this content.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.text.TextContentparse
- 
Field Details- 
stringThe field for thestringrecord component.
 
- 
- 
Constructor Details- 
LiteralTextContentCreates an instance of aLiteralTextContentrecord class.- Parameters:
- string- the value for the- stringrecord component
 
 
- 
- 
Method Details- 
visitVisits this content. Returns a value if the visitor terminates amid the visit, orOptional.empty()if it proceeds.- Specified by:
- visitin interface- TextContent
- Returns:
- Optional.empty()if the visit finished, or a terminating result from the- visitor
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lsx;a(Lta$a;)Ljava/util/Optional;- intermediary - method_27659- Lnet/minecraft/class_7417;method_27659(Lnet/minecraft/class_5348$class_5245;)Ljava/util/Optional;- named - visit- Lnet/minecraft/text/TextContent;visit(Lnet/minecraft/text/StringVisitable$Visitor;)Ljava/util/Optional;
 
- 
visitVisits this content. Returns a value if the visitor terminates amid the visit, orOptional.empty()if it proceeds.- Specified by:
- visitin interface- TextContent
- Returns:
- Optional.empty()if the visit finished, or a terminating result from the- visitor
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lsx;a(Lta$b;Lts;)Ljava/util/Optional;- intermediary - method_27660- Lnet/minecraft/class_7417;method_27660(Lnet/minecraft/class_5348$class_5246;Lnet/minecraft/class_2583;)Ljava/util/Optional;- named - visit- Lnet/minecraft/text/TextContent;visit(Lnet/minecraft/text/StringVisitable$StyledVisitor;Lnet/minecraft/text/Style;)Ljava/util/Optional;
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
stringReturns the value of thestringrecord component.- Returns:
- the value of the stringrecord component
 
 
-