java.lang.Object
com.thecoderscorner.menu.domain.MenuItem<Boolean>
com.thecoderscorner.menu.domain.BooleanMenuItem

public class BooleanMenuItem extends MenuItem<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.
  • Constructor Details

    • BooleanMenuItem

      public BooleanMenuItem()
    • BooleanMenuItem

      public BooleanMenuItem(String name, String varName, int id, int eepromAddress, String functionName, BooleanMenuItem.BooleanNaming naming, boolean readOnly, boolean localOnly, boolean visible)
  • Method Details

    • 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<Boolean> newMenuState(Boolean value, boolean changed, boolean active)
      returns a new menu state object, suitable for storing the current value
      Specified by:
      newMenuState in class MenuItem<Boolean>
      Parameters:
      value - the new value
      changed - if the item has changed
      active - if the item is active
      Returns:
      a menu state.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • accept

      public void accept(MenuItemVisitor visitor)
      Specified by:
      accept in class MenuItem<Boolean>