-
Notifications
You must be signed in to change notification settings - Fork 1
/
PolicyItem.java
executable file
·111 lines (92 loc) · 2.3 KB
/
PolicyItem.java
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
101
102
103
104
105
106
107
108
109
110
111
package com.hwx.ranger;
import java.util.List;
public class PolicyItem {
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "PolicyItem [accesses=" + accesses + ", users=" + users
+ ", groups=" + groups + ", conditions=" + conditions
+ ", delegateAdmin=" + delegateAdmin + "]";
}
private List<Access> accesses = null;
private List<String> users = null;
private List<String> groups = null;
private List<Object> conditions = null;
private boolean delegateAdmin;
public List<Access> getAccesses() {
return accesses;
}
public void setAccesses(List<Access> accesses) {
this.accesses = accesses;
}
public List<String> getUsers() {
return users;
}
public void setUsers(List<String> users) {
this.users = users;
}
public List<String> getGroups() {
return groups;
}
public void setGroups(List<String> groups) {
this.groups = groups;
}
public List<Object> getConditions() {
return conditions;
}
public void setConditions(List<Object> conditions) {
this.conditions = conditions;
}
public boolean isDelegateAdmin() {
return delegateAdmin;
}
public void setDelegateAdmin(boolean delegateAdmin) {
this.delegateAdmin = delegateAdmin;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((accesses == null) ? 0 : accesses.hashCode());
result = prime * result + (delegateAdmin ? 1231 : 1237);
result = prime * result + ((groups == null) ? 0 : groups.hashCode());
result = prime * result + ((users == null) ? 0 : users.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PolicyItem other = (PolicyItem) obj;
if (accesses == null) {
if (other.accesses != null)
return false;
} else if (!accesses.equals(other.accesses))
return false;
if (delegateAdmin != other.delegateAdmin)
return false;
if (groups == null) {
if (other.groups != null)
return false;
} else if (!groups.equals(other.groups))
return false;
if (users == null) {
if (other.users != null)
return false;
} else if (!users.equals(other.users))
return false;
return true;
}
}