liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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;
    }
}