Package org.molgenis.web.menu.model
Interface MenuNode
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(Predicate<MenuNode> predicate)Checks if this Menu node contains a menu node matching the given predicateOptional<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.@NotEmpty StringgetId()@NotEmpty StringgetLabel()Optional<List<String>>getPath(String id)Returns the path from this menu node to the menu with given ID.booleanisMenu()
-
-
-
Method Detail
-
getId
@NotEmpty @NotEmpty String getId()
- Returns:
- the ID of this menu node
-
getLabel
@NotEmpty @NotEmpty String getLabel()
- Returns:
- the label of this menu node to use when displaying the menu
-
isMenu
boolean isMenu()
- Returns:
- true if this is a menu, false if it is a menu item
-
filter
Optional<MenuNode> filter(Predicate<MenuNode> predicate)
Filters all Menu nodes by applying the predicate to their items.- Parameters:
predicate-Predicateto apply to the items- Returns:
- the filtered menu node
-
getPath
Optional<List<String>> getPath(String id)
Returns the path from this menu node to the menu with given ID.- 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
boolean contains(Predicate<MenuNode> predicate)
Checks if this Menu node contains a menu node matching the given predicate- Parameters:
predicate- the predicate to match- Returns:
- boolean true if it contains a matching node, else false
-
-