01: /*
02: * Copyright (C) 2007 <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package test.nz.org.take.r2ml.scenario3;
20:
21: /**
22: * Bean class referenced in tests.
23: * @author <a href="http://www-ist.massey.ac.nz/JBDietrich/">Jens Dietrich</a>
24: */
25: public class Person {
26:
27: private String name = null;
28:
29: public Person(String name) {
30: super ();
31: this .name = name;
32: }
33:
34: public String getName() {
35: return name;
36: }
37:
38: public void setName(String name) {
39: this .name = name;
40: }
41:
42: @Override
43: public int hashCode() {
44: final int PRIME = 31;
45: int result = 1;
46: result = PRIME * result
47: + ((name == null) ? 0 : name.hashCode());
48: return result;
49: }
50:
51: @Override
52: public boolean equals(Object obj) {
53: if (this == obj)
54: return true;
55: if (obj == null)
56: return false;
57: if (getClass() != obj.getClass())
58: return false;
59: final Person other = (Person) obj;
60: if (name == null) {
61: if (other.name != null)
62: return false;
63: } else if (!name.equals(other.name))
64: return false;
65: return true;
66: }
67: }
|