Package com.thecoderscorner.menu.domain
Class BooleanMenuItem
- java.lang.Object
-
- com.thecoderscorner.menu.domain.MenuItem<java.lang.Boolean>
-
- com.thecoderscorner.menu.domain.BooleanMenuItem
-
public class BooleanMenuItem extends MenuItem<java.lang.Boolean>
A menu item that can only hold boolean values (true or false). The naming can be changed such that the boolean can be represented with different text. Rather than using the constructor use the BooleanMenuItemBuilder to build one.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBooleanMenuItem.BooleanNaming
-
Field Summary
-
Fields inherited from class com.thecoderscorner.menu.domain.MenuItem
eepromAddress, functionName, id, localOnly, name, readOnly, visible
-
-
Constructor Summary
Constructors Constructor Description BooleanMenuItem()BooleanMenuItem(java.lang.String name, int id, int eepromAddress, java.lang.String functionName, BooleanMenuItem.BooleanNaming naming, boolean readOnly, boolean localOnly, boolean visible)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(MenuItemVisitor visitor)booleanequals(java.lang.Object o)BooleanMenuItem.BooleanNaminggetNaming()returns the naming for this boolean, that describes how to render the true/false choice.inthashCode()MenuState<java.lang.Boolean>newMenuState(java.lang.Boolean value, boolean changed, boolean active)returns a new menu state object, suitable for storing the current value-
Methods inherited from class com.thecoderscorner.menu.domain.MenuItem
getEepromAddress, getFunctionName, getId, getName, hasChildren, isLocalOnly, isReadOnly, isVisible, toString
-
-
-
-
Constructor Detail
-
BooleanMenuItem
public BooleanMenuItem()
-
BooleanMenuItem
public BooleanMenuItem(java.lang.String name, int id, int eepromAddress, java.lang.String functionName, BooleanMenuItem.BooleanNaming naming, boolean readOnly, boolean localOnly, boolean visible)
-
-
Method Detail
-
getNaming
public BooleanMenuItem.BooleanNaming getNaming()
returns the naming for this boolean, that describes how to render the true/false choice.- Returns:
- the possible naming schemes.
-
newMenuState
public MenuState<java.lang.Boolean> newMenuState(java.lang.Boolean value, boolean changed, boolean active)
returns a new menu state object, suitable for storing the current value- Specified by:
newMenuStatein classMenuItem<java.lang.Boolean>- Parameters:
value- the new valuechanged- if the item has changedactive- if the item is active- Returns:
- a menu state.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
accept
public void accept(MenuItemVisitor visitor)
-
-