Enum Class MenuCache

java.lang.Object
java.lang.Enum<MenuCache>
com.jbstrap.core.cache.MenuCache
All Implemented Interfaces:
Serializable, Comparable<MenuCache>, Constable

public enum MenuCache extends Enum<MenuCache>
Since:
4.0
Author:
JBStrap
  • Enum Constant Details

    • INSTANCE

      public static final MenuCache INSTANCE
  • Method Details

    • values

      public static MenuCache[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MenuCache valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • addMenu

      public void addMenu(String menuName)
      Parameters:
      menuName - The menu name. The name must be specified, and it must be unique within the application
      Throws:
      NullPointerException - If the name is not specified
      IllegalArgumentException - If the name already exists in the cache
    • getMenuItems

      public List<MenuItem> getMenuItems(String menuName)
      Parameters:
      menuName - The menu name
      Returns:
      Lista a menüben szereplő összes menüelemről vagy A list of every menu item from the specified menu or null, if the specified menu is not found
      Throws:
      NullPointerException - IF the menu name is not specified
    • removeMenu

      public void removeMenu(String menuName)
      Parameters:
      menuName - The menu name. If null this method won't do anything
    • addMenuItemToMenu

      public void addMenuItemToMenu(String menuName, MenuItem menuItem)
      Parameters:
      menuName - The name of the menu, where the new menu item will be added
      menuItem - The new menu item POJO class
      Throws:
      NullPointerException - If the menu name was not specifie,d or if the menu isn't found.
    • removeMenuItem

      public void removeMenuItem(String menuName, String menuItemName)
      Parameters:
      menuName - The menu name, from where the menu item will be removed
      menuItemName - The menu item name, that will be removed from the menu
    • reorderMenuByItem

      public void reorderMenuByItem(MenuItem item)
      Parameters:
      item - The menu item POJO class
    • getMenuNames

      public List<String> getMenuNames()
      Returns:
      A list of every menu item in the cache. If there are none, the returned list will be empty