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 import java.util.ArrayList;
24 import java.util.Date;
25 import java.util.List;
26
27
28
29
30
31 public class SubjectConfirmationDataBean {
32 private String recipient;
33 private String address;
34 private String inResponseTo;
35 private Instant notBefore;
36 private Instant notAfter;
37 private List<Object> any;
38
39
40
41
42 public SubjectConfirmationDataBean() {
43 }
44
45
46
47
48
49 public String getRecipient() {
50 return recipient;
51 }
52
53
54
55
56
57 public void setRecipient(String recipient) {
58 this.recipient = recipient;
59 }
60
61
62
63
64
65 public String getAddress() {
66 return address;
67 }
68
69
70
71
72
73 public void setAddress(String address) {
74 this.address = address;
75 }
76
77
78
79
80
81 public String getInResponseTo() {
82 return inResponseTo;
83 }
84
85
86
87
88
89 public void setInResponseTo(String inResponseTo) {
90 this.inResponseTo = inResponseTo;
91 }
92
93
94
95
96
97 public Instant getNotBefore() {
98 return notBefore;
99 }
100
101
102
103
104
105
106 public void setNotBefore(Instant notBefore) {
107 if (notBefore != null) {
108 this.notBefore = Date.from(notBefore).toInstant();
109 } else {
110 this.notBefore = null;
111 }
112 }
113
114
115
116
117
118 public Instant getNotAfter() {
119 return notAfter;
120 }
121
122
123
124
125
126
127 public void setNotAfter(Instant notAfter) {
128 if (notAfter != null) {
129 this.notAfter = Date.from(notAfter).toInstant();
130 } else {
131 this.notAfter = null;
132 }
133 }
134
135
136
137
138
139
140 public List<Object> getAny() {
141 return any;
142 }
143
144
145
146
147
148
149 public void setAny(List<Object> any) {
150 this.any = any;
151 }
152
153
154
155
156
157
158 public void addAny(Object obj) {
159 if (any == null) {
160 any = new ArrayList<>();
161 }
162 any.add(obj);
163 }
164
165
166
167
168
169
170
171 @Override
172 public boolean equals(Object o) {
173 if (this == o) {
174 return true;
175 }
176 if (!(o instanceof SubjectConfirmationDataBean)) {
177 return false;
178 }
179
180 SubjectConfirmationDataBean that = (SubjectConfirmationDataBean) o;
181
182 if (recipient == null && that.recipient != null) {
183 return false;
184 } else if (recipient != null && !recipient.equals(that.recipient)) {
185 return false;
186 }
187
188 if (address == null && that.address != null) {
189 return false;
190 } else if (address != null && !address.equals(that.address)) {
191 return false;
192 }
193
194 if (inResponseTo == null && that.inResponseTo != null) {
195 return false;
196 } else if (inResponseTo != null && !inResponseTo.equals(that.inResponseTo)) {
197 return false;
198 }
199
200 if (notBefore == null && that.notBefore != null) {
201 return false;
202 } else if (notBefore != null && !notBefore.equals(that.notBefore)) {
203 return false;
204 }
205
206 if (notAfter == null && that.notAfter != null) {
207 return false;
208 } else if (notAfter != null && !notAfter.equals(that.notAfter)) {
209 return false;
210 }
211
212 if (any == null && that.any != null) {
213 return false;
214 } else if (any != null && !any.equals(that.any)) {
215 return false;
216 }
217
218 return true;
219 }
220
221
222
223
224 @Override
225 public int hashCode() {
226 int result = 0;
227 if (recipient != null) {
228 result = recipient.hashCode();
229 }
230 if (address != null) {
231 result = 31 * result + address.hashCode();
232 }
233 if (inResponseTo != null) {
234 result = 31 * result + inResponseTo.hashCode();
235 }
236 if (notBefore != null) {
237 result = 31 * result + notBefore.hashCode();
238 }
239 if (notAfter != null) {
240 result = 31 * result + notAfter.hashCode();
241 }
242 if (any != null) {
243 result = 31 * result + any.hashCode();
244 }
245 return result;
246 }
247
248 }