package com.basic.x01.systemMenu;
|
|
import java.util.HashMap;
|
import java.util.LinkedList;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* 菜单类
|
*
|
*
|
* @company 北京贝思科技术有限公司
|
* @author liuyajun, 8384503@qq.com
|
* @date 2016年1月11日
|
* @time 下午8:06:01
|
*/
|
public class MenuItem {
|
protected String id;
|
protected String parId;
|
protected String idPath;
|
protected String titlePath;
|
protected int level = 0;
|
protected String actionId;
|
protected String title;
|
protected boolean menu;
|
protected boolean publicMenu;
|
protected boolean button;
|
protected boolean required;
|
protected MenuItem parent;
|
|
protected Map<String,String> other = new HashMap<String,String>();
|
|
protected List<MenuItem> subMenuList = new LinkedList<MenuItem>();
|
protected List<MenuItem> subButtonList = new LinkedList<MenuItem>();
|
|
public String getOther(String key){
|
return this.other.get(key);
|
}
|
public String getId() {
|
return id;
|
}
|
public String getParId() {
|
return parId;
|
}
|
public String getIdPath() {
|
return idPath;
|
}
|
public String getTitlePath() {
|
return titlePath;
|
}
|
public String getActionId() {
|
return actionId;
|
}
|
public String getTitle() {
|
return title;
|
}
|
public boolean isMenu() {
|
return menu;
|
}
|
public boolean isPublicMenu() {
|
return publicMenu;
|
}
|
public MenuItem getParent() {
|
return parent;
|
}
|
|
public String toString(){
|
StringBuffer s = new StringBuffer();
|
s.append("level:").append(level).append("[").append(idPath).append(",")
|
.append(actionId).append(",").append(title).append(",")
|
.append(titlePath).append("]");
|
return s.toString();
|
}
|
public int getLevel() {
|
return level;
|
}
|
public List<MenuItem> getSubMenuList() {
|
return subMenuList;
|
}
|
public List<MenuItem> getSubButtonList() {
|
return subButtonList;
|
}
|
@Override
|
public boolean equals(Object obj) {
|
if(obj==null){
|
return false;
|
}
|
if(! (obj instanceof MenuItem)){
|
return false;
|
}
|
|
return this.actionId.equals(((MenuItem)obj).getActionId());
|
}
|
public boolean isRequired() {
|
return required;
|
}
|
public boolean isButton() {
|
return button;
|
}
|
}
|