Class MenuItemHelper
java.lang.Object
com.thecoderscorner.menu.domain.util.MenuItemHelper
A helper class for dealing with MenuItem objects. This class provides the helper for visiting
menu items and returning a result. It also provides other helpers for dealing with items.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SubMenuItemReturns the menu item as a sub menu or nullstatic MenuItemcreateFromExistingWithId(MenuItem selected, int newId) creates a copy of the menu item chosen, with the ID changed to newIdstatic inteepromSizeForItem(MenuItem item) Gets the size of the eeprom storage for a given element typestatic Optional<BootItemMenuCommand<?,?>> getBootMsgForItem(MenuItem item, SubMenuItem parent, MenuTree tree) static <T> TgetValueFor(MenuItem item, MenuTree tree, T def) static booleanCheck if the item is based on a runtime itemstatic voidsetMenuState(MenuItem item, Object value, MenuTree tree) static AnyMenuStatestateForMenuItem(MenuItem item, Object val, boolean changed, boolean active) static AnyMenuStatestateForMenuItem(AnyMenuState existingState, MenuItem item, Object val) static AnyMenuStatestateForMenuItem(AnyMenuState existingState, MenuItem item, Object val, boolean changed) static <T> Optional<T>visitWithResult(MenuItem item, AbstractMenuItemVisitor<T> visitor) Visits a menu item calling the appropriate function for the type and collects the result that is set by calling your visitor's `setResult` method.
-
Constructor Details
-
MenuItemHelper
public MenuItemHelper()
-
-
Method Details