Record Class NumberRangeInput
java.lang.Object
java.lang.Record
net.minecraft.server.dialog.input.NumberRangeInput
- All Implemented Interfaces:
InputControl
public record NumberRangeInput(int width, Component label, String labelFormat, NumberRangeInput.RangeInfo rangeInfo)
extends Record
implements InputControl
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Component
The field for thelabel
record component.private final String
The field for thelabelFormat
record component.static final com.mojang.serialization.MapCodec
<NumberRangeInput> private final NumberRangeInput.RangeInfo
The field for therangeInfo
record component.private final int
The field for thewidth
record component. -
Constructor Summary
ConstructorsConstructorDescriptionNumberRangeInput
(int width, Component label, String labelFormat, NumberRangeInput.RangeInfo rangeInfo) Creates an instance of aNumberRangeInput
record class. -
Method Summary
Modifier and TypeMethodDescriptioncomputeLabel
(String p_426283_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.label()
Returns the value of thelabel
record component.Returns the value of thelabelFormat
record component.com.mojang.serialization.MapCodec
<NumberRangeInput> mapCodec()
Returns the value of therangeInfo
record component.final String
toString()
Returns a string representation of this record class.int
width()
Returns the value of thewidth
record component.
-
Field Details
-
width
private final int widthThe field for thewidth
record component. -
label
The field for thelabel
record component. -
labelFormat
The field for thelabelFormat
record component. -
rangeInfo
The field for therangeInfo
record component. -
MAP_CODEC
-
-
Constructor Details
-
NumberRangeInput
public NumberRangeInput(int width, Component label, String labelFormat, NumberRangeInput.RangeInfo rangeInfo) Creates an instance of aNumberRangeInput
record class.- Parameters:
width
- the value for thewidth
record componentlabel
- the value for thelabel
record componentlabelFormat
- the value for thelabelFormat
record componentrangeInfo
- the value for therangeInfo
record component
-
-
Method Details
-
mapCodec
- Specified by:
mapCodec
in interfaceInputControl
-
computeLabel
-
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. -
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
width
public int width()Returns the value of thewidth
record component.- Returns:
- the value of the
width
record component
-
label
Returns the value of thelabel
record component.- Returns:
- the value of the
label
record component
-
labelFormat
Returns the value of thelabelFormat
record component.- Returns:
- the value of the
labelFormat
record component
-
rangeInfo
Returns the value of therangeInfo
record component.- Returns:
- the value of the
rangeInfo
record component
-