1 7 package org.jboss.test.xml.book; 8 9 15 public class BookCharacter 16 { 17 private String name; 18 private String friendOf; 19 private String since; 20 private String qualification; 21 22 public String getName() 23 { 24 return name; 25 } 26 27 public void setName(String name) 28 { 29 this.name = name; 30 } 31 32 public String getFriendOf() 33 { 34 return friendOf; 35 } 36 37 public void setFriendOf(String friendOf) 38 { 39 this.friendOf = friendOf; 40 } 41 42 public String getSince() 43 { 44 return since; 45 } 46 47 public void setSince(String since) 48 { 49 this.since = since; 50 } 51 52 public String getQualification() 53 { 54 return qualification; 55 } 56 57 public void setQualification(String qualification) 58 { 59 this.qualification = qualification; 60 } 61 62 public boolean equals(Object o) 63 { 64 if(this == o) return true; 65 if(!(o instanceof BookCharacter)) return false; 66 67 final BookCharacter bookCharacter = (BookCharacter)o; 68 69 if(friendOf != null ? !friendOf.equals(bookCharacter.friendOf) : bookCharacter.friendOf != null) return false; 70 if(name != null ? !name.equals(bookCharacter.name) : bookCharacter.name != null) return false; 71 if(qualification != null ? !qualification.equals(bookCharacter.qualification) : bookCharacter.qualification != null) return false; 72 if(since != null ? !since.equals(bookCharacter.since) : bookCharacter.since != null) return false; 73 74 return true; 75 } 76 77 public int hashCode() 78 { 79 int result; 80 result = (name != null ? name.hashCode() : 0); 81 result = 29 * result + (friendOf != null ? friendOf.hashCode() : 0); 82 result = 29 * result + (since != null ? since.hashCode() : 0); 83 result = 29 * result + (qualification != null ? qualification.hashCode() : 0); 84 return result; 85 } 86 87 public String toString() 88 { 89 StringBuffer sb = new StringBuffer (50); 90 sb.append('[') 91 .append("name=").append(name) 92 .append(", friend-of=").append(friendOf) 93 .append(", since=").append(since) 94 .append(", qualification=").append(qualification) 95 .append(']'); 96 return sb.toString(); 97 } 98 } 99 | Popular Tags |