public class MenuItem<M extends MenuItem> extends Object implements Serializable, AbsrtactHierarchialItem<M>, Comparable<M>
name
s are case insensitive while comparing.Constructor and Description |
---|
MenuItem() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MenuItem mi) |
boolean |
equals(Object o)
Compares the
refId as long as they are not null. |
List<M> |
getChildren()
Represents the Children sub-menu items of this item
|
Integer |
getLevel()
Indicate how down in the hierarchy is this.
|
String |
getName()
Name / id
|
MenuItem |
getParent()
Deprecated.
see
children : Not sufficient use cases currently to support that this is required.
It adds overhead to maintain this field that may not be required. |
String |
getRefId()
A String that denotes where the item Points to.
|
int |
hashCode() |
boolean |
isNavigable()
true indicates that if refId is available then one can navigate using this item.
|
void |
setChildren(List<M> children)
Represents the Children sub-menu items of this item
|
void |
setLevel(Integer level)
Indicate how down in the hierarchy is this.
|
void |
setName(String name)
Name / id
|
void |
setNavigable(boolean navigatable)
true indicates that if refId is available then one can navigate using this item.
|
void |
setParent(M parent)
Deprecated.
see
children : Not sufficient use cases currently to support that this is required.
It adds overhead to maintain this field that may not be required. |
void |
setRefId(String refId)
A String that denotes where the item Points to.
|
String |
toString() |
public String getName()
public void setName(String name)
public String getRefId()
public void setRefId(String refId)
public List<M> getChildren()
getChildren
in interface AbsrtactHierarchialItem<M extends MenuItem>
public void setChildren(List<M> children)
public boolean isNavigable()
public void setNavigable(boolean navigatable)
@Deprecated public MenuItem getParent()
children
: Not sufficient use cases currently to support that this is required.
It adds overhead to maintain this field that may not be required.@Deprecated public void setParent(M parent)
children
: Not sufficient use cases currently to support that this is required.
It adds overhead to maintain this field that may not be required.parent
- public Integer getLevel()
getLevel
in interface AbsrtactHierarchialItem<M extends MenuItem>
public void setLevel(Integer level)
public boolean equals(Object o)
refId
as long as they are not null.
By default compared the refid to ensure, the exact same Menu Item, since names *may* match/duplicate in a different part of the menu hierarchy.
TODO: Add unit test casepublic int compareTo(MenuItem mi)
compareTo
in interface Comparable<M extends MenuItem>
Copyright © 2018. All rights reserved.