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.test.xml.book;
023:
024: /**
025: * BookCharacter class that represents the character element in XML content.
026: *
027: * @version <tt>$Revision: 57211 $</tt>
028: * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
029: */
030: public class BookCharacter {
031: private String name;
032: private String friendOf;
033: private String since;
034: private String qualification;
035:
036: public String getName() {
037: return name;
038: }
039:
040: public void setName(String name) {
041: this .name = name;
042: }
043:
044: public String getFriendOf() {
045: return friendOf;
046: }
047:
048: public void setFriendOf(String friendOf) {
049: this .friendOf = friendOf;
050: }
051:
052: public String getSince() {
053: return since;
054: }
055:
056: public void setSince(String since) {
057: this .since = since;
058: }
059:
060: public String getQualification() {
061: return qualification;
062: }
063:
064: public void setQualification(String qualification) {
065: this .qualification = qualification;
066: }
067:
068: public boolean equals(Object o) {
069: if (this == o)
070: return true;
071: if (!(o instanceof BookCharacter))
072: return false;
073:
074: final BookCharacter bookCharacter = (BookCharacter) o;
075:
076: if (friendOf != null ? !friendOf.equals(bookCharacter.friendOf)
077: : bookCharacter.friendOf != null)
078: return false;
079: if (name != null ? !name.equals(bookCharacter.name)
080: : bookCharacter.name != null)
081: return false;
082: if (qualification != null ? !qualification
083: .equals(bookCharacter.qualification)
084: : bookCharacter.qualification != null)
085: return false;
086: if (since != null ? !since.equals(bookCharacter.since)
087: : bookCharacter.since != null)
088: return false;
089:
090: return true;
091: }
092:
093: public int hashCode() {
094: int result;
095: result = (name != null ? name.hashCode() : 0);
096: result = 29 * result
097: + (friendOf != null ? friendOf.hashCode() : 0);
098: result = 29 * result + (since != null ? since.hashCode() : 0);
099: result = 29
100: * result
101: + (qualification != null ? qualification.hashCode() : 0);
102: return result;
103: }
104:
105: public String toString() {
106: StringBuffer sb = new StringBuffer(50);
107: sb.append('[').append("name=").append(name).append(
108: ", friend-of=").append(friendOf).append(", since=")
109: .append(since).append(", qualification=").append(
110: qualification).append(']');
111: return sb.toString();
112: }
113: }
|