01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.openejb.test.object;
17:
18: /**
19: *
20: * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
21: * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
22: */
23: public class Account implements java.io.Serializable {
24:
25: private String ssn;
26: private String firstName;
27: private String lastName;
28: private int balance;
29:
30: public Account(String ssn, String firstName, String lastName,
31: int balance) {
32: this .ssn = ssn;
33: this .firstName = firstName.trim();
34: this .lastName = lastName.trim();
35: this .balance = balance;
36: }
37:
38: public Account() {
39: }
40:
41: public boolean equals(Object object) {
42: if (!(object instanceof Account))
43: return false;
44:
45: Account that = (Account) object;
46:
47: return (this .ssn.equals(that.ssn)
48: && this .firstName.equals(that.firstName)
49: && this .lastName.equals(that.lastName) && this .balance == that.balance);
50: }
51:
52: public String getSsn() {
53: return ssn;
54: }
55:
56: public void setSsn(String ssn) {
57: this .ssn = ssn;
58: }
59:
60: public String getFirstName() {
61: return firstName;
62: }
63:
64: public void setFirstName(String firstName) {
65: this .firstName = (firstName != null) ? firstName.trim() : null;
66: }
67:
68: public String getLastName() {
69: return lastName;
70: }
71:
72: public void setLastName(String lastName) {
73: this .lastName = (lastName != null) ? lastName.trim() : null;
74: }
75:
76: public int getBalance() {
77: return balance;
78: }
79:
80: public void setBalance(int balance) {
81: this .balance = balance;
82: }
83:
84: public String toString() {
85: return "[" + ssn + "][" + firstName + "][" + lastName + "]["
86: + balance + "]";
87: }
88: }
|