1 24 25 package org.objectweb.tribe.common; 26 27 import java.io.Serializable ; 28 29 36 public class Member implements Serializable 37 { 38 private Address address; 39 private String uid; 40 41 47 public Member(Address address, String uid) 48 { 49 this.address = address; 50 this.uid = uid; 51 } 52 53 58 public Address getAddress() 59 { 60 return address; 61 } 62 63 68 public void setAddress(Address address) 69 { 70 this.address = address; 71 } 72 73 78 public String getUid() 79 { 80 return uid; 81 } 82 83 88 public void setUid(String uid) 89 { 90 this.uid = uid; 91 } 92 93 96 public boolean equals(Object obj) 97 { 98 if (obj instanceof Member) 99 { 100 Member m = (Member) obj; 101 return uid.equals(m.uid) && address.equals(m.address); 102 } 103 return false; 104 } 105 106 109 public int hashCode() 110 { 111 return uid.hashCode() + address.hashCode(); 112 } 113 114 117 public String toString() 118 { 119 return uid + "[" + address + "]"; 120 } 121 122 } | Popular Tags |