001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.ejb3.test.clusteredentity.classloader;
023:
024: import java.io.IOException;
025: import java.io.ObjectInputStream;
026: import java.io.Serializable;
027:
028: /**
029: * Comment
030: *
031: * @author Brian Stansberry
032: * @version $Revision: 60233 $
033: */
034: public class AccountHolderPK implements Serializable {
035: private static final long serialVersionUID = 1L;
036:
037: private String lastName;
038: private String ssn;
039: private transient boolean deserialized;
040:
041: public AccountHolderPK() {
042: }
043:
044: public AccountHolderPK(String lastName, String ssn) {
045: this .lastName = lastName;
046: this .ssn = ssn;
047: }
048:
049: public String getLastName() {
050: return this .lastName;
051: }
052:
053: public void setLastName(String lastName) {
054: this .lastName = lastName;
055: }
056:
057: public String getSsn() {
058: return ssn;
059: }
060:
061: public void setSsn(String ssn) {
062: this .ssn = ssn;
063: }
064:
065: public boolean equals(Object obj) {
066: if (obj == this )
067: return true;
068: if (!(obj instanceof AccountHolderPK))
069: return false;
070: AccountHolderPK pk = (AccountHolderPK) obj;
071: if (!lastName.equals(pk.lastName))
072: return false;
073: if (!ssn.equals(pk.ssn))
074: return false;
075: return true;
076: }
077:
078: public int hashCode() {
079: int result = 17;
080: result = result * 31 + lastName.hashCode();
081: result = result * 31 + ssn.hashCode();
082: return result;
083: }
084:
085: public String toString() {
086: StringBuffer sb = new StringBuffer(getClass().getName());
087: sb.append("[lastName=");
088: sb.append(lastName);
089: sb.append(",ssn=");
090: sb.append(ssn);
091: sb.append(",deserialized=");
092: sb.append(deserialized);
093: sb.append("]");
094: return sb.toString();
095: }
096:
097: private void readObject(ObjectInputStream ois) throws IOException,
098: ClassNotFoundException {
099: ois.defaultReadObject();
100: deserialized = true;
101: }
102:
103: }
|