01: /*
02: * $Id: Person.java 471756 2006-11-06 15:01:43Z husted $
03: *
04: * Licensed to the Apache Software Foundation (ASF) under one
05: * or more contributor license agreements. See the NOTICE file
06: * distributed with this work for additional information
07: * regarding copyright ownership. The ASF licenses this file
08: * to you under the Apache License, Version 2.0 (the
09: * "License"); you may not use this file except in compliance
10: * with the License. You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing,
15: * software distributed under the License is distributed on an
16: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17: * KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations
19: * under the License.
20: */
21: package org.apache.struts2.showcase.person;
22:
23: /**
24: */
25: public class Person {
26: Long id;
27: String name;
28: String lastName;
29:
30: public Person() {
31: }
32:
33: public Person(Long id, String name, String lastName) {
34: this .id = id;
35: this .name = name;
36: this .lastName = lastName;
37: }
38:
39: public Long getId() {
40: return id;
41: }
42:
43: public void setId(Long id) {
44: this .id = id;
45: }
46:
47: public String getName() {
48: return name;
49: }
50:
51: public void setName(String name) {
52: this .name = name;
53: }
54:
55: public String getLastName() {
56: return lastName;
57: }
58:
59: public void setLastName(String lastName) {
60: this .lastName = lastName;
61: }
62:
63: public boolean equals(Object o) {
64: if (this == o)
65: return true;
66: if (o == null || getClass() != o.getClass())
67: return false;
68:
69: final Person person = (Person) o;
70:
71: if (id != null ? !id.equals(person.id) : person.id != null)
72: return false;
73:
74: return true;
75: }
76:
77: public int hashCode() {
78: return (id != null ? id.hashCode() : 0);
79: }
80:
81: public String toString() {
82: return "Person{" + "id=" + id + ", name='" + name + '\''
83: + ", lastName='" + lastName + '\'' + '}';
84: }
85: }
|