1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.wss4j.common.saml.bean;
21
22 import java.util.List;
23 import java.util.ArrayList;
24
25
26
27
28
29
30 public class AuthDecisionStatementBean {
31
32
33
34
35 private SubjectBean subject;
36
37
38
39
40 public enum Decision { PERMIT, INDETERMINATE, DENY }
41
42
43
44
45 private Decision decision;
46
47
48
49
50 private String resource;
51
52
53
54
55 private List<ActionBean> actionBeans;
56
57
58
59
60 private Object evidence;
61
62
63
64
65 public AuthDecisionStatementBean() {
66 actionBeans = new ArrayList<>();
67 }
68
69
70
71
72
73
74
75
76
77
78 public AuthDecisionStatementBean(
79 Decision decision,
80 String resource,
81 SubjectBean subject,
82 Object evidence,
83 List<ActionBean> actionBeans
84 ) {
85 this.decision = decision;
86 this.resource = resource;
87 this.subject = subject;
88 this.evidence = evidence;
89 this.actionBeans = actionBeans;
90 }
91
92
93
94
95
96
97 public String getResource() {
98 return resource;
99 }
100
101
102
103
104
105
106 public void setResource(String resource) {
107 this.resource = resource;
108 }
109
110
111
112
113
114
115 public List<ActionBean> getActions() {
116 return actionBeans;
117 }
118
119
120
121
122
123
124 public void setActions(List<ActionBean> actionBeans) {
125 this.actionBeans = actionBeans;
126 }
127
128
129
130
131
132
133 public Decision getDecision() {
134 return decision;
135 }
136
137
138
139
140
141
142 public void setDecision(Decision decision) {
143 this.decision = decision;
144 }
145
146
147
148
149
150
151 public Object getEvidence() {
152 return evidence;
153 }
154
155
156
157
158
159
160 public void setEvidence(Object evidence) {
161 this.evidence = evidence;
162 }
163
164
165
166
167
168 public SubjectBean getSubject() {
169 return subject;
170 }
171
172
173
174
175
176 public void setSubject(SubjectBean subject) {
177 this.subject = subject;
178 }
179
180 @Override
181 public boolean equals(Object o) {
182 if (this == o) {
183 return true;
184 }
185 if (!(o instanceof AuthDecisionStatementBean)) {
186 return false;
187 }
188
189 AuthDecisionStatementBean that = (AuthDecisionStatementBean) o;
190
191 if (subject == null && that.subject != null) {
192 return false;
193 } else if (subject != null && !subject.equals(that.subject)) {
194 return false;
195 }
196
197 if (decision == null && that.decision != null) {
198 return false;
199 } else if (decision != null && !decision.equals(that.decision)) {
200 return false;
201 }
202
203 if (evidence == null && that.evidence != null) {
204 return false;
205 } else if (evidence != null && !evidence.equals(that.evidence)) {
206 return false;
207 }
208
209 if (actionBeans == null && that.actionBeans != null) {
210 return false;
211 } else if (actionBeans != null && !actionBeans.equals(that.actionBeans)) {
212 return false;
213 }
214
215 if (resource == null && that.resource != null) {
216 return false;
217 } else if (resource != null && !resource.equals(that.resource)) {
218 return false;
219 }
220
221 return true;
222 }
223
224 @Override
225 public int hashCode() {
226 int result = subject != null ? subject.hashCode() : 0;
227 result = 31 * result + (decision != null ? decision.hashCode() : 0);
228 result = 31 * result + (evidence != null ? evidence.hashCode() : 0);
229 result = 31 * result + (actionBeans != null ? actionBeans.hashCode() : 0);
230 result = 31 * result + (resource != null ? resource.hashCode() : 0);
231 return result;
232 }
233 }