Record Class MultiLineLabel.TextAndWidth
java.lang.Object
java.lang.Record
net.minecraft.client.gui.components.MultiLineLabel.TextAndWidth
- Enclosing interface:
MultiLineLabel
public static record MultiLineLabel.TextAndWidth(FormattedCharSequence text, int width)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FormattedCharSequenceThe field for thetextrecord component.private final intThe field for thewidthrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTextAndWidth(FormattedCharSequence text, int width) Creates an instance of aTextAndWidthrecord class. -
Method Summary
Modifier 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.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Field Details
-
text
The field for thetextrecord component. -
width
private final int widthThe field for thewidthrecord component.
-
-
Constructor Details
-
TextAndWidth
Creates an instance of aTextAndWidthrecord class.- Parameters:
text- the value for thetextrecord componentwidth- the value for thewidthrecord component
-
-
Method Details
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-