1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.jdtaus.banking.dtaus;
22
23 import java.io.Serializable;
24 import java.util.Calendar;
25 import java.util.Currency;
26 import java.util.Date;
27 import org.jdtaus.banking.AlphaNumericText27;
28 import org.jdtaus.banking.Bankleitzahl;
29 import org.jdtaus.banking.Kontonummer;
30 import org.jdtaus.banking.Referenznummer10;
31
32
33
34
35
36
37
38 public class Header implements Cloneable, Serializable
39 {
40
41
42 public static final String PROP_CUSTOMER = "org.jdtaus.banking.dtaus.Header.PROP_CUSTOMER";
43
44
45 public static final String PROP_ACCOUNT = "org.jdtaus.banking.dtaus.Header.PROP_ACCOUNT";
46
47
48 public static final String PROP_BANK = "org.jdtaus.banking.dtaus.Header.PROP_BANK";
49
50
51 public static final String PROP_TYPE = "org.jdtaus.banking.dtaus.Header.PROP_TYPE";
52
53
54 public static final String PROP_CURRENCY = "org.jdtaus.banking.dtaus.Header.PROP_CURRENCY";
55
56
57 public static final String PROP_REFERENCE = "org.jdtaus.banking.dtaus.Header.PROP_REFERENCE";
58
59
60 public static final String PROP_BANKDATA = "org.jdtaus.banking.dtaus.Header.PROP_BANKDATA";
61
62
63 public static final String PROP_CREATEDATE = "org.jdtaus.banking.dtaus.Header.PROP_CREATEDATE";
64
65
66 public static final String PROP_EXECUTIONDATE = "org.jdtaus.banking.dtaus.Header.PROP_EXECUTIONDATE";
67
68
69 private static final long serialVersionUID = -5704199858711059732L;
70
71
72
73
74
75 private AlphaNumericText27 customer;
76
77
78
79
80
81 private Kontonummer account;
82
83
84
85
86
87 private Bankleitzahl bank;
88
89
90
91
92
93 private LogicalFileType type;
94
95
96
97
98
99 private Currency currency;
100
101
102
103
104
105 private Referenznummer10 reference;
106
107
108
109
110
111 private Date createDate;
112
113
114
115
116
117 private Date executionDate;
118
119
120
121
122
123 private Bankleitzahl bankData;
124
125
126 private transient int hashCode = NO_HASHCODE;
127 private static final int NO_HASHCODE = Integer.MIN_VALUE;
128
129
130 public Header()
131 {
132 super();
133 }
134
135
136
137
138
139
140 public AlphaNumericText27 getCustomer()
141 {
142 return this.customer;
143 }
144
145
146
147
148
149
150 public void setCustomer( final AlphaNumericText27 value )
151 {
152 this.customer = value;
153 this.hashCode = NO_HASHCODE;
154 }
155
156
157
158
159
160
161 public Kontonummer getAccount()
162 {
163 return this.account;
164 }
165
166
167
168
169
170
171 public void setAccount( final Kontonummer value )
172 {
173 this.account = value;
174 this.hashCode = NO_HASHCODE;
175 }
176
177
178
179
180
181
182 public Bankleitzahl getBank()
183 {
184 return this.bank;
185 }
186
187
188
189
190
191
192 public void setBank( final Bankleitzahl value )
193 {
194 this.bank = value;
195 this.hashCode = NO_HASHCODE;
196 }
197
198
199
200
201
202
203 public LogicalFileType getType()
204 {
205 return this.type;
206 }
207
208
209
210
211
212
213 public void setType( final LogicalFileType value )
214 {
215 this.type = value;
216 this.hashCode = NO_HASHCODE;
217 }
218
219
220
221
222
223
224 public Currency getCurrency()
225 {
226 return this.currency;
227 }
228
229
230
231
232
233
234 public void setCurrency( final Currency value )
235 {
236 this.currency = value;
237 this.hashCode = NO_HASHCODE;
238 }
239
240
241
242
243
244
245 public Referenznummer10 getReference()
246 {
247 return this.reference;
248 }
249
250
251
252
253
254
255 public void setReference( final Referenznummer10 value )
256 {
257 this.reference = value;
258 this.hashCode = NO_HASHCODE;
259 }
260
261
262
263
264
265
266 public Date getCreateDate()
267 {
268 return this.createDate != null ? (Date) this.createDate.clone() : null;
269 }
270
271
272
273
274
275
276 public void setCreateDate( final Date value )
277 {
278 this.createDate = null;
279 this.hashCode = NO_HASHCODE;
280
281 if ( value != null )
282 {
283 final Calendar cal = Calendar.getInstance();
284 cal.setTime( value );
285 cal.clear( Calendar.HOUR_OF_DAY );
286 cal.clear( Calendar.MINUTE );
287 cal.clear( Calendar.SECOND );
288 cal.clear( Calendar.MILLISECOND );
289 this.createDate = cal.getTime();
290 }
291 }
292
293
294
295
296
297
298 public Date getExecutionDate()
299 {
300 return this.executionDate != null ? (Date) this.executionDate.clone() : null;
301 }
302
303
304
305
306
307
308 public void setExecutionDate( final Date value )
309 {
310 this.executionDate = null;
311 this.hashCode = NO_HASHCODE;
312
313 if ( value != null )
314 {
315 final Calendar cal = Calendar.getInstance();
316 cal.setTime( value );
317 cal.clear( Calendar.HOUR_OF_DAY );
318 cal.clear( Calendar.MINUTE );
319 cal.clear( Calendar.SECOND );
320 cal.clear( Calendar.MILLISECOND );
321 this.executionDate = cal.getTime();
322 }
323 }
324
325
326
327
328
329
330 public Bankleitzahl getBankData()
331 {
332 return this.bankData;
333 }
334
335
336
337
338
339
340 public void setBankData( final Bankleitzahl value )
341 {
342 this.bankData = value;
343 this.hashCode = NO_HASHCODE;
344 }
345
346
347
348
349
350
351
352
353 public boolean equals( final Object o )
354 {
355 boolean ret = o == this;
356
357 if ( !ret && o instanceof Header )
358 {
359 final Header that = (Header) o;
360 ret = ( this.getAccount() == null
361 ? that.getAccount() == null : this.getAccount().equals( that.getAccount() ) ) &&
362 ( this.getBank() == null
363 ? that.getBank() == null : this.getBank().equals( that.getBank() ) ) &&
364 ( this.getBankData() == null
365 ? that.getBankData() == null : this.getBankData().equals( that.getBankData() ) ) &&
366 ( this.getCurrency() == null
367 ? that.getCurrency() == null : this.getCurrency().equals( that.getCurrency() ) ) &&
368 ( this.getCustomer() == null
369 ? that.getCustomer() == null : this.getCustomer().equals( that.getCustomer() ) ) &&
370 ( this.getType() == null
371 ? that.getType() == null : this.getType().equals( that.getType() ) ) &&
372 ( this.getReference() == null
373 ? that.getReference() == null : this.getReference().equals( that.getReference() ) ) &&
374 ( this.getCreateDate() == null
375 ? that.getCreateDate() == null : this.getCreateDate().equals( that.getCreateDate() ) ) &&
376 ( this.getExecutionDate() == null
377 ? that.getExecutionDate() == null : this.getExecutionDate().equals( that.getExecutionDate() ) );
378
379 }
380
381 return ret;
382 }
383
384
385
386
387
388
389 public int hashCode()
390 {
391 if ( this.hashCode == NO_HASHCODE )
392 {
393 int hc = 23;
394 hc = 37 * hc + ( this.account == null ? 0 : this.account.hashCode() );
395 hc = 37 * hc + ( this.bank == null ? 0 : this.bank.hashCode() );
396 hc = 37 * hc + ( this.bankData == null ? 0 : this.bankData.hashCode() );
397 hc = 37 * hc + ( this.currency == null ? 0 : this.currency.hashCode() );
398 hc = 37 * hc + ( this.customer == null ? 0 : this.customer.hashCode() );
399 hc = 37 * hc + ( this.type == null ? 0 : this.type.hashCode() );
400 hc = 37 * hc + ( this.reference == null ? 0 : this.reference.hashCode() );
401 hc = 37 * hc + ( this.createDate == null ? 0 : this.createDate.hashCode() );
402 hc = 37 * hc + ( this.executionDate == null ? 0 : this.executionDate.hashCode() );
403 this.hashCode = hc;
404 }
405
406 return this.hashCode;
407 }
408
409
410
411
412
413
414 public Object clone()
415 {
416 try
417 {
418 final Object o = super.clone();
419 if ( this.createDate != null )
420 {
421 ( (Header) o ).createDate = (Date) this.createDate.clone();
422 }
423 if ( this.executionDate != null )
424 {
425 ( (Header) o ).executionDate = (Date) this.executionDate.clone();
426 }
427
428 return o;
429 }
430 catch ( final CloneNotSupportedException e )
431 {
432 throw new AssertionError( e );
433 }
434 }
435
436
437
438
439
440
441 public String toString()
442 {
443 return super.toString() + this.internalString();
444 }
445
446
447
448
449
450
451 private String internalString()
452 {
453 return new StringBuffer( 150 ).append( '{' ).
454 append( "account=" ).append( this.account ).
455 append( ", bank=" ).append( this.bank ).
456 append( ", bankData=" ).append( this.bankData ).
457 append( ", currency=" ).append( this.currency ).
458 append( ", customer=" ).append( (Object) this.customer ).
459 append( ", createDate=" ).append( this.createDate ).
460 append( ", executionDate=" ).append( this.executionDate ).
461 append( ", type=" ).append( this.type ).
462 append( ", reference=" ).append( this.reference ).
463 append( '}' ).toString();
464
465 }
466
467 }