Record Class SingleOptionInput
java.lang.Object
java.lang.Record
net.minecraft.server.dialog.input.SingleOptionInput
- All Implemented Interfaces:
InputControl
public record SingleOptionInput(int width, List<SingleOptionInput.Entry> entries, Component label, boolean labelVisible)
extends Record
implements InputControl
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<SingleOptionInput.Entry> The field for theentries
record component.private final Component
The field for thelabel
record component.private final boolean
The field for thelabelVisible
record component.static final com.mojang.serialization.MapCodec
<SingleOptionInput> private final int
The field for thewidth
record component. -
Constructor Summary
ConstructorsConstructorDescriptionSingleOptionInput
(int width, List<SingleOptionInput.Entry> entries, Component label, boolean labelVisible) Creates an instance of aSingleOptionInput
record class. -
Method Summary
Modifier and TypeMethodDescriptionentries()
Returns the value of theentries
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.initial()
label()
Returns the value of thelabel
record component.boolean
Returns the value of thelabelVisible
record component.com.mojang.serialization.MapCodec
<SingleOptionInput> mapCodec()
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. -
entries
The field for theentries
record component. -
label
The field for thelabel
record component. -
labelVisible
private final boolean labelVisibleThe field for thelabelVisible
record component. -
MAP_CODEC
-
-
Constructor Details
-
SingleOptionInput
public SingleOptionInput(int width, List<SingleOptionInput.Entry> entries, Component label, boolean labelVisible) Creates an instance of aSingleOptionInput
record class.- Parameters:
width
- the value for thewidth
record componententries
- the value for theentries
record componentlabel
- the value for thelabel
record componentlabelVisible
- the value for thelabelVisible
record component
-
-
Method Details
-
mapCodec
- Specified by:
mapCodec
in interfaceInputControl
-
initial
-
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
-
entries
Returns the value of theentries
record component.- Returns:
- the value of the
entries
record component
-
label
Returns the value of thelabel
record component.- Returns:
- the value of the
label
record component
-
labelVisible
public boolean labelVisible()Returns the value of thelabelVisible
record component.- Returns:
- the value of the
labelVisible
record component
-