Package net.minecraft.world.entity
Record Class Display.TextDisplay.CachedLine
java.lang.Object
java.lang.Record
net.minecraft.world.entity.Display.TextDisplay.CachedLine
- Enclosing class:
- Display.TextDisplay
public static record Display.TextDisplay.CachedLine(FormattedCharSequence contents, int width)
extends Record
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final FormattedCharSequenceThe field for thecontentsrecord component.private final intThe field for thewidthrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionCachedLine(FormattedCharSequence contents, int width) Creates an instance of aCachedLinerecord class.
- 
Method SummaryModifier and TypeMethodDescriptioncontents()Returns the value of thecontentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
- 
Field Details- 
contentsThe field for thecontentsrecord component.
- 
widthprivate final int widthThe field for thewidthrecord component.
 
- 
- 
Constructor Details- 
CachedLineCreates an instance of aCachedLinerecord class.- Parameters:
- contents- the value for the- contentsrecord component
- width- the value for the- widthrecord component
 
 
- 
- 
Method Details- 
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='.
- 
contentsReturns the value of thecontentsrecord component.- Returns:
- the value of the contentsrecord component
 
- 
widthpublic int width()Returns the value of thewidthrecord component.- Returns:
- the value of the widthrecord component
 
 
-