Record Class SwitchGrid.LabeledSwitch
java.lang.Object
java.lang.Record
net.minecraft.client.gui.screens.worldselection.SwitchGrid.LabeledSwitch
- Enclosing class:
SwitchGrid
static record SwitchGrid.LabeledSwitch(CycleButton<Boolean> button, BooleanSupplier stateSupplier, @Nullable BooleanSupplier isActiveCondition)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final CycleButton<Boolean>
The field for thebutton
record component.private final BooleanSupplier
The field for theisActiveCondition
record component.private final BooleanSupplier
The field for thestateSupplier
record component. -
Constructor Summary
ConstructorDescriptionLabeledSwitch
(CycleButton<Boolean> button, BooleanSupplier stateSupplier, BooleanSupplier isActiveCondition) Creates an instance of aLabeledSwitch
record class. -
Method Summary
Modifier and TypeMethodDescriptionbutton()
Returns the value of thebutton
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.Returns the value of theisActiveCondition
record component.void
Returns the value of thestateSupplier
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
button
The field for thebutton
record component. -
stateSupplier
The field for thestateSupplier
record component. -
isActiveCondition
The field for theisActiveCondition
record component.
-
-
Constructor Details
-
LabeledSwitch
LabeledSwitch(CycleButton<Boolean> button, BooleanSupplier stateSupplier, @Nullable BooleanSupplier isActiveCondition) Creates an instance of aLabeledSwitch
record class.- Parameters:
button
- the value for thebutton
record componentstateSupplier
- the value for thestateSupplier
record componentisActiveCondition
- the value for theisActiveCondition
record component
-
-
Method Details
-
refreshState
public void refreshState() -
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
button
Returns the value of thebutton
record component.- Returns:
- the value of the
button
record component
-
stateSupplier
Returns the value of thestateSupplier
record component.- Returns:
- the value of the
stateSupplier
record component
-
isActiveCondition
Returns the value of theisActiveCondition
record component.- Returns:
- the value of the
isActiveCondition
record component
-