Package org.molgenis.web.menu.model
Class MenuItem
- java.lang.Object
-
- org.molgenis.web.menu.model.MenuItem
-
-
Constructor Summary
Constructors Constructor Description MenuItem()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancontains(Predicate<MenuNode> predicate)Checks if this Menu node contains a menu node matching the given predicatestatic MenuItemcreate(String id, String label)static MenuItemcreate(String id, String label, String params)Optional<MenuNode>filter(Predicate<MenuNode> predicate)Filters all Menu nodes by applying the predicate to their items.Optional<MenuItem>firstItem()Finds the first menu item in this menu node.abstract StringgetParams()Optional<List<String>>getPath(String id)Returns the path from this menu node to the menu with given ID.StringgetUrl()booleanisMenu()
-
-
-
Method Detail
-
filter
public Optional<MenuNode> filter(Predicate<MenuNode> predicate)
Description copied from interface:MenuNodeFilters all Menu nodes by applying the predicate to their items.
-
getPath
public Optional<List<String>> getPath(String id)
Description copied from interface:MenuNodeReturns the path from this menu node to the menu with given ID.- Specified by:
getPathin interfaceMenuNode- Parameters:
id- the ID of the menu to look for- Returns:
- Optional List of Strings of the IDs of the menus leading up to the specified id, or
Optional.empty()if this menu does not contain a node with the specified ID
-
contains
public boolean contains(Predicate<MenuNode> predicate)
Description copied from interface:MenuNodeChecks if this Menu node contains a menu node matching the given predicate
-
firstItem
public Optional<MenuItem> firstItem()
Description copied from interface:MenuNodeFinds the first menu item in this menu node. If it is a menu, this is the first item of its first child.
-
isMenu
public boolean isMenu()
-
getUrl
public String getUrl()
- Returns:
- the URL of this menu item, which is the combination of its ID and its parameters.
-
-