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.time.Instant;
23
24
25
26
27
28 public class AuthenticationStatementBean {
29 private SubjectBean subject;
30 private Instant sessionNotOnOrAfter;
31 private Instant authenticationInstant;
32 private String authenticationMethod;
33 private SubjectLocalityBean subjectLocality;
34 private String sessionIndex;
35
36
37
38
39 public AuthenticationStatementBean() {
40 }
41
42
43
44
45
46
47
48
49
50 public AuthenticationStatementBean(
51 SubjectBean subject,
52 String authenticationMethod,
53 Instant authenticationInstant,
54 Instant sessionNotOnOrAfter
55 ) {
56 this.subject = subject;
57 this.authenticationMethod = authenticationMethod;
58 this.authenticationInstant = authenticationInstant;
59 this.sessionNotOnOrAfter = sessionNotOnOrAfter;
60 }
61
62
63
64
65
66 public SubjectBean getSubject() {
67 return subject;
68 }
69
70
71
72
73
74 public void setSubject(SubjectBean subject) {
75 this.subject = subject;
76 }
77
78
79
80
81
82 public String getAuthenticationMethod() {
83 return authenticationMethod;
84 }
85
86
87
88
89
90 public void setAuthenticationMethod(String authenticationMethod) {
91 this.authenticationMethod = authenticationMethod;
92 }
93
94
95
96
97
98 public Instant getAuthenticationInstant() {
99 return authenticationInstant;
100 }
101
102
103
104
105
106 public void setAuthenticationInstant(Instant authenticationInstant) {
107 this.authenticationInstant = authenticationInstant;
108 }
109
110
111
112
113
114 public Instant getSessionNotOnOrAfter() {
115 return sessionNotOnOrAfter;
116 }
117
118
119
120
121
122 public void setSessionNotOnOrAfter(Instant sessionNotOnOrAfter) {
123 this.sessionNotOnOrAfter = sessionNotOnOrAfter;
124 }
125
126
127
128
129
130
131 public final SubjectLocalityBean getSubjectLocality() {
132 return subjectLocality;
133 }
134
135
136
137
138
139
140 public final void setSubjectLocality(final SubjectLocalityBean subjectLocality) {
141 this.subjectLocality = subjectLocality;
142 }
143
144
145
146
147
148
149 public final String getSessionIndex() {
150 return sessionIndex;
151 }
152
153
154
155
156
157
158 public final void setSessionIndex(final String sessionIndex) {
159 this.sessionIndex = sessionIndex;
160 }
161
162 @Override
163 public boolean equals(Object o) {
164 if (this == o) {
165 return true;
166 }
167 if (!(o instanceof AuthenticationStatementBean)) {
168 return false;
169 }
170
171 AuthenticationStatementBean that = (AuthenticationStatementBean) o;
172
173 if (authenticationInstant == null && that.authenticationInstant != null) {
174 return false;
175 } else if (authenticationInstant != null
176 && !authenticationInstant.equals(that.authenticationInstant)) {
177 return false;
178 }
179
180 if (sessionNotOnOrAfter == null && that.sessionNotOnOrAfter != null) {
181 return false;
182 } else if (sessionNotOnOrAfter != null
183 && !sessionNotOnOrAfter.equals(that.sessionNotOnOrAfter)) {
184 return false;
185 }
186
187 if (authenticationMethod == null && that.authenticationMethod != null) {
188 return false;
189 } else if (authenticationMethod != null
190 && !authenticationMethod.equals(that.authenticationMethod)) {
191 return false;
192 }
193
194 if (subject == null && that.subject != null) {
195 return false;
196 } else if (subject != null
197 && !subject.equals(that.subject)) {
198 return false;
199 }
200
201 if (subjectLocality == null && that.subjectLocality != null) {
202 return false;
203 } else if (subjectLocality != null && !subjectLocality.equals(that.subjectLocality)) {
204 return false;
205 }
206
207 if (sessionIndex == null && that.sessionIndex != null) {
208 return false;
209 } else if (sessionIndex != null && !sessionIndex.equals(that.sessionIndex)) {
210 return false;
211 }
212
213 return true;
214 }
215
216 @Override
217 public int hashCode() {
218 int result = subject != null ? subject.hashCode() : 0;
219 result = 31 * result + (authenticationInstant != null ? authenticationInstant.hashCode() : 0);
220 result = 31 * result + (sessionNotOnOrAfter != null ? sessionNotOnOrAfter.hashCode() : 0);
221 result = 31 * result + (authenticationMethod != null ? authenticationMethod.hashCode() : 0);
222 result = 31 * result + (subjectLocality != null ? subjectLocality.hashCode() : 0);
223 result = 31 * result + (sessionIndex != null ? sessionIndex.hashCode() : 0);
224 return result;
225 }
226 }