1 16 package org.apache.juddi.datatype.business; 17 18 import java.util.Vector ; 19 20 import org.apache.juddi.datatype.Address; 21 import org.apache.juddi.datatype.Description; 22 import org.apache.juddi.datatype.Email; 23 import org.apache.juddi.datatype.PersonName; 24 import org.apache.juddi.datatype.Phone; 25 import org.apache.juddi.datatype.RegistryObject; 26 27 33 public class Contact implements RegistryObject 35 { 36 String useType; 37 Vector descVector; 38 String personName; 39 Vector phoneVector; 40 Vector emailAddrVector; 41 Vector addressVector; 42 43 46 public Contact() 47 { 48 } 49 50 57 public Contact(String name) 58 { 59 this.setPersonNameValue(name); 60 } 61 62 72 public Contact(String name,String type) 73 { 74 this(name); 75 this.useType = type; 76 } 77 78 83 public void addDescription(Description description) 84 { 85 if (this.descVector == null) 86 this.descVector = new Vector (); 87 this.descVector.add(description); 88 } 89 90 95 public void setDescriptionVector(Vector descriptions) 96 { 97 this.descVector = descriptions; 98 } 99 100 106 public Vector getDescriptionVector() 107 { 108 return this.descVector; 109 } 110 111 118 public void setUseType(String type) 119 { 120 this.useType = type; 121 } 122 123 131 public String getUseType() 132 { 133 return useType; 134 } 135 136 143 public String getPersonNameValue() 144 { 145 return personName; 146 } 147 148 155 public PersonName getPersonName() 156 { 157 if (this.personName == null) 158 return null; 159 else 160 return new PersonName(this.personName); 161 } 162 163 170 public void setPersonNameValue(String name) 171 { 172 this.personName = name; 173 } 174 175 182 public void setPersonName(PersonName personName) 183 { 184 if (personName != null) 185 this.personName = personName.getValue(); 186 else 187 this.personName = null; 188 } 189 190 195 public void addAddress(Address address) 196 { 197 if (address == null) 199 return; 200 201 if (this.addressVector == null) 202 this.addressVector = new Vector (); 203 this.addressVector.add(address); 204 } 205 206 211 public void setAddressVector(Vector adds) 212 { 213 this.addressVector = adds; 214 } 215 216 222 public Vector getAddressVector() 223 { 224 return this.addressVector; 225 } 226 227 232 public void addPhone(Phone phone) 233 { 234 if (phone == null) 236 return; 237 238 if (this.phoneVector == null) 239 this.phoneVector = new Vector (); 240 this.phoneVector.add(phone); 241 } 242 243 250 public void setPhoneVector(Vector phones) 251 { 252 this.phoneVector = phones; 253 } 254 255 262 public Vector getPhoneVector() 263 { 264 return this.phoneVector; 265 } 266 267 272 public void addEmail(Email email) 273 { 274 if (email == null) 276 return; 277 278 if (this.emailAddrVector == null) 279 this.emailAddrVector = new Vector (); 280 this.emailAddrVector.add(email); 281 } 282 283 289 public void setEmailVector(Vector emailAddresses) 290 { 291 this.emailAddrVector = emailAddresses; 292 } 293 294 301 public Vector getEmailVector() 302 { 303 return this.emailAddrVector; 304 } 305 } | Popular Tags |