1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.ws.security.saml.ext.bean;
21
22 import org.joda.time.DateTime;
23
24
25
26
27
28
29
30
31 public class AuthenticationStatementBean {
32 private SubjectBean subject;
33 DateTime authenticationInstant;
34 private String authenticationMethod;
35 private SubjectLocalityBean subjectLocality;
36 private String sessionIndex;
37
38
39
40
41 public AuthenticationStatementBean() {
42 }
43
44
45
46
47
48
49
50
51 public AuthenticationStatementBean(
52 SubjectBean subject,
53 String authenticationMethod,
54 DateTime authenticationInstant
55 ) {
56 this.subject = subject;
57 this.authenticationMethod = authenticationMethod;
58 this.authenticationInstant = authenticationInstant;
59 }
60
61
62
63
64
65 public SubjectBean getSubject() {
66 return subject;
67 }
68
69
70
71
72
73 public void setSubject(SubjectBean subject) {
74 this.subject = subject;
75 }
76
77
78
79
80
81 public String getAuthenticationMethod() {
82 return authenticationMethod;
83 }
84
85
86
87
88
89 public void setAuthenticationMethod(String authenticationMethod) {
90 this.authenticationMethod = authenticationMethod;
91 }
92
93
94
95
96
97 public DateTime getAuthenticationInstant() {
98 return authenticationInstant;
99 }
100
101
102
103
104
105 public void setAuthenticationInstant(DateTime authenticationInstant) {
106 this.authenticationInstant = authenticationInstant;
107 }
108
109
110
111
112
113
114 public final SubjectLocalityBean getSubjectLocality() {
115 return subjectLocality;
116 }
117
118
119
120
121
122
123 public final void setSubjectLocality(final SubjectLocalityBean subjectLocality) {
124 this.subjectLocality = subjectLocality;
125 }
126
127
128
129
130
131
132 public final String getSessionIndex() {
133 return sessionIndex;
134 }
135
136
137
138
139
140
141 public final void setSessionIndex(final String sessionIndex) {
142 this.sessionIndex = sessionIndex;
143 }
144
145 @Override
146 public boolean equals(Object o) {
147 if (this == o) return true;
148 if (!(o instanceof AuthenticationStatementBean)) return false;
149
150 AuthenticationStatementBean that = (AuthenticationStatementBean) o;
151
152 if (authenticationInstant == null && that.authenticationInstant != null) {
153 return false;
154 } else if (authenticationInstant != null
155 && !authenticationInstant.equals(that.authenticationInstant)) {
156 return false;
157 }
158
159 if (authenticationMethod == null && that.authenticationMethod != null) {
160 return false;
161 } else if (authenticationMethod != null
162 && !authenticationMethod.equals(that.authenticationMethod)) {
163 return false;
164 }
165
166 if (subject == null && that.subject != null) {
167 return false;
168 } else if (subject != null
169 && !subject.equals(that.subject)) {
170 return false;
171 }
172
173 if (subjectLocality == null && that.subjectLocality != null) {
174 return false;
175 } else if (subjectLocality != null && !subjectLocality.equals(that.subjectLocality)) {
176 return false;
177 }
178
179 if (sessionIndex == null && that.sessionIndex != null) {
180 return false;
181 } else if (sessionIndex != null && !sessionIndex.equals(that.sessionIndex)) {
182 return false;
183 }
184
185 return true;
186 }
187
188 @Override
189 public int hashCode() {
190 int result = subject != null ? subject.hashCode() : 0;
191 result = 31 * result + (authenticationInstant != null ? authenticationInstant.hashCode() : 0);
192 result = 31 * result + (authenticationMethod != null ? authenticationMethod.hashCode() : 0);
193 result = 31 * result + (subjectLocality != null ? subjectLocality.hashCode() : 0);
194 result = 31 * result + (sessionIndex != null ? sessionIndex.hashCode() : 0);
195 return result;
196 }
197 }