Record Class LiteralContents
java.lang.Object
java.lang.Record
net.minecraft.network.chat.contents.LiteralContents
- All Implemented Interfaces:
- ComponentContents
- 
Field SummaryFieldsFields inherited from interface net.minecraft.network.chat.ComponentContentsEMPTY
- 
Constructor SummaryConstructorsConstructorDescriptionLiteralContents(String text) Creates an instance of aLiteralContentsrecord 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.text()Returns the value of thetextrecord component.toString()Returns a string representation of this record class.<T> Optional<T>visit(FormattedText.ContentConsumer<T> p_237373_) <T> Optional<T>visit(FormattedText.StyledContentConsumer<T> p_237375_, Style p_237376_) Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.chat.ComponentContentsresolve
- 
Field Details- 
textThe field for thetextrecord component.
 
- 
- 
Constructor Details- 
LiteralContentsCreates an instance of aLiteralContentsrecord class.- Parameters:
- text- the value for the- textrecord component
 
 
- 
- 
Method Details- 
visit- Specified by:
- visitin interface- ComponentContents
 
- 
visit- Specified by:
- visitin interface- ComponentContents
 
- 
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).
- 
textReturns the value of thetextrecord component.- Returns:
- the value of the textrecord component
 
 
-