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 theentriesrecord component.private final ComponentThe field for thelabelrecord component.private final booleanThe field for thelabelVisiblerecord component.static final com.mojang.serialization.MapCodec<SingleOptionInput> private final intThe field for thewidthrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSingleOptionInput(int width, List<SingleOptionInput.Entry> entries, Component label, boolean labelVisible) Creates an instance of aSingleOptionInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionentries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.initial()label()Returns the value of thelabelrecord component.booleanReturns the value of thelabelVisiblerecord component.com.mojang.serialization.MapCodec<SingleOptionInput> mapCodec()final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Field Details
-
width
private final int widthThe field for thewidthrecord component. -
entries
The field for theentriesrecord component. -
label
The field for thelabelrecord component. -
labelVisible
private final boolean labelVisibleThe field for thelabelVisiblerecord component. -
MAP_CODEC
-
-
Constructor Details
-
SingleOptionInput
public SingleOptionInput(int width, List<SingleOptionInput.Entry> entries, Component label, boolean labelVisible) Creates an instance of aSingleOptionInputrecord class.- Parameters:
width- the value for thewidthrecord componententries- the value for theentriesrecord componentlabel- the value for thelabelrecord componentlabelVisible- the value for thelabelVisiblerecord component
-
-
Method Details
-
mapCodec
- Specified by:
mapCodecin 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 thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
entries
Returns the value of theentriesrecord component.- Returns:
- the value of the
entriesrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
labelVisible
public boolean labelVisible()Returns the value of thelabelVisiblerecord component.- Returns:
- the value of the
labelVisiblerecord component
-