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 SummaryFieldsModifier and TypeFieldDescriptionprivate final CycleButton<Boolean>The field for thebuttonrecord component.private final BooleanSupplierThe field for theisActiveConditionrecord component.private final BooleanSupplierThe field for thestateSupplierrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionLabeledSwitch(CycleButton<Boolean> button, BooleanSupplier stateSupplier, BooleanSupplier isActiveCondition) Creates an instance of aLabeledSwitchrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionbutton()Returns the value of thebuttonrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theisActiveConditionrecord component.voidReturns the value of thestateSupplierrecord component.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
buttonThe field for thebuttonrecord component.
- 
stateSupplierThe field for thestateSupplierrecord component.
- 
isActiveConditionThe field for theisActiveConditionrecord component.
 
- 
- 
Constructor Details- 
LabeledSwitchLabeledSwitch(CycleButton<Boolean> button, BooleanSupplier stateSupplier, @Nullable BooleanSupplier isActiveCondition) Creates an instance of aLabeledSwitchrecord class.- Parameters:
- button- the value for the- buttonrecord component
- stateSupplier- the value for the- stateSupplierrecord component
- isActiveCondition- the value for the- isActiveConditionrecord component
 
 
- 
- 
Method Details- 
refreshStatepublic void refreshState()
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
buttonReturns the value of thebuttonrecord component.- Returns:
- the value of the buttonrecord component
 
- 
stateSupplierReturns the value of thestateSupplierrecord component.- Returns:
- the value of the stateSupplierrecord component
 
- 
isActiveConditionReturns the value of theisActiveConditionrecord component.- Returns:
- the value of the isActiveConditionrecord component
 
 
-