01: /*
02: * Copyright (C) 2006 Joe Walnes.
03: * Copyright (C) 2006, 2007 XStream Committers.
04: * All rights reserved.
05: *
06: * The software in this package is published under the terms of the BSD
07: * style license a copy of which has been included with this distribution in
08: * the LICENSE.txt file.
09: *
10: * Created on 15. July 2006 by Joe Walnes
11: */
12: package com.thoughtworks.xstream.tools.benchmark.targets;
13:
14: import java.util.Date;
15: import java.io.Serializable;
16:
17: /**
18: * @see UserDefinedClassTarget
19: */
20: public class Person implements Serializable {
21:
22: public String firstName;
23: public String lastName;
24: public Date dateOfBirth;
25:
26: public boolean equals(Object o) {
27: if (this == o)
28: return true;
29: if (o == null || getClass() != o.getClass())
30: return false;
31:
32: final Person person = (Person) o;
33:
34: if (dateOfBirth != null ? !dateOfBirth
35: .equals(person.dateOfBirth)
36: : person.dateOfBirth != null)
37: return false;
38: if (firstName != null ? !firstName.equals(person.firstName)
39: : person.firstName != null)
40: return false;
41: return !(lastName != null ? !lastName.equals(person.lastName)
42: : person.lastName != null);
43: }
44:
45: public int hashCode() {
46: int result;
47: result = (firstName != null ? firstName.hashCode() : 0);
48: result = 29 * result
49: + (lastName != null ? lastName.hashCode() : 0);
50: result = 29 * result
51: + (dateOfBirth != null ? dateOfBirth.hashCode() : 0);
52: return result;
53: }
54: }
|