Record Class NativeUiToggle
java.lang.Object
java.lang.Record
com.viaversion.viafabricplus.bedrock.screen.ui.NativeUiToggle
public record NativeUiToggle(boolean radio, boolean defaultChecked, boolean directional, boolean toggleOnHover, int group, int onButton, int offButton, int forcedIndex, int defaultSelected)
extends Record
Native toggle initialization and component events; the screen owns collection indices and radio traversal.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final class -
Constructor Summary
ConstructorsConstructorDescriptionNativeUiToggle(boolean radio, boolean defaultChecked, boolean directional, boolean toggleOnHover, int group, int onButton, int offButton, int forcedIndex, int defaultSelected) Creates an instance of aNativeUiTogglerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thedefaultCheckedrecord component.intReturns the value of thedefaultSelectedrecord component.booleanReturns the value of thedirectionalrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theforcedIndexrecord component.intgroup()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.intindex(int collectionIndex) booleaninitialChecked(int collectionIndex) intReturns the value of theoffButtonrecord component.intonButton()Returns the value of theonButtonrecord component.static NativeUiToggleparse(com.google.gson.JsonObject properties) booleanradio()Returns the value of theradiorecord component.booleanReturns the value of thetoggleOnHoverrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NativeUiToggle
public NativeUiToggle(boolean radio, boolean defaultChecked, boolean directional, boolean toggleOnHover, int group, int onButton, int offButton, int forcedIndex, int defaultSelected) Creates an instance of aNativeUiTogglerecord class.- Parameters:
radio- the value for theradiorecord componentdefaultChecked- the value for thedefaultCheckedrecord componentdirectional- the value for thedirectionalrecord componenttoggleOnHover- the value for thetoggleOnHoverrecord componentgroup- the value for thegrouprecord componentonButton- the value for theonButtonrecord componentoffButton- the value for theoffButtonrecord componentforcedIndex- the value for theforcedIndexrecord componentdefaultSelected- the value for thedefaultSelectedrecord component
-
-
Method Details
-
parse
-
index
public int index(int collectionIndex) -
initialChecked
public boolean initialChecked(int collectionIndex) -
toString
-
hashCode
-
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 with thecomparemethod from their corresponding wrapper classes. -
radio
public boolean radio()Returns the value of theradiorecord component.- Returns:
- the value of the
radiorecord component
-
defaultChecked
public boolean defaultChecked()Returns the value of thedefaultCheckedrecord component.- Returns:
- the value of the
defaultCheckedrecord component
-
directional
public boolean directional()Returns the value of thedirectionalrecord component.- Returns:
- the value of the
directionalrecord component
-
toggleOnHover
public boolean toggleOnHover()Returns the value of thetoggleOnHoverrecord component.- Returns:
- the value of the
toggleOnHoverrecord component
-
group
public int group()Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
onButton
public int onButton()Returns the value of theonButtonrecord component.- Returns:
- the value of the
onButtonrecord component
-
offButton
public int offButton()Returns the value of theoffButtonrecord component.- Returns:
- the value of the
offButtonrecord component
-
forcedIndex
public int forcedIndex()Returns the value of theforcedIndexrecord component.- Returns:
- the value of the
forcedIndexrecord component
-
defaultSelected
public int defaultSelected()Returns the value of thedefaultSelectedrecord component.- Returns:
- the value of the
defaultSelectedrecord component
-