Package com.jbstrap.core.cache
Enum Class MenuCache
- All Implemented Interfaces:
Serializable
,Comparable<MenuCache>
,Constable
- Since:
- 4.0
- Author:
- JBStrap
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addMenuItemToMenu
(String menuName, MenuItem menuItem) getMenuItems
(String menuName) boolean
menuItemIsExists
(String menuName, String menuItemName) void
removeMenu
(String menuName) void
removeMenuItem
(String menuName, String menuItemName) void
reorderMenuByItem
(MenuItem item) static MenuCache
Returns the enum constant of this class with the specified name.static MenuCache[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
addMenu
- 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 specifiedIllegalArgumentException
- If the name already exists in the cache
-
getMenuItems
- 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
- Parameters:
menuName
- The menu name. Ifnull
this method won't do anything
-
addMenuItemToMenu
- Parameters:
menuName
- The name of the menu, where the new menu item will be addedmenuItem
- The new menu item POJO class- Throws:
NullPointerException
- If the menu name was not specifie,d or if the menu isn't found.
-
removeMenuItem
- Parameters:
menuName
- The menu name, from where the menu item will be removedmenuItemName
- The menu item name, that will be removed from the menu
-
reorderMenuByItem
- Parameters:
item
- The menu item POJO class
-
getMenuNames
- Returns:
- A list of every menu item in the cache. If there are none, the returned list will be empty
-