1 package org.jahia.webapps.addressbook; 2 3 import java.util.*; 4 5 import org.jahia.tools.*; 6 import org.jahia.tools.db.*; 7 8 16 public class Contact { 17 18 protected int id = -1; 19 private int addbook_id = 0; 20 private String last_name = ""; 21 private String first_name = ""; 22 private String civil_title = ""; 23 private String prof_title = ""; 24 private String company = ""; 25 private String address1 = ""; 26 private String address2 = ""; 27 private String city = ""; 28 private String zip = ""; 29 private String state = ""; 30 private String country = ""; 31 private String notes = ""; 32 private int category = -1; 33 private int[] comm_ids = new int[5]; 34 private String [] comm_values = new String [5]; 35 private int commid_0 = 0; 36 private int commid_1= 0; 37 private int commid_2= 0; 38 private int commid_3 = 0; 39 private int commid_4 = 0; 40 private String commval_0 = null; 41 private String commval_1= null; 42 private String commval_2= null; 43 private String commval_3 = null; 44 private String commval_4 = null; 45 46 47 50 public Contact() { 51 for(int i=0; i<5; i++) { 53 comm_ids[i] = 0; 54 comm_values[i] = ""; 55 } 56 commval_0= comm_values[0]; 57 commval_1=comm_values[1]; 58 commval_2=comm_values[2]; 59 commval_3=comm_values[3]; 60 commval_4=comm_values[4]; 61 commid_0 = comm_ids[0]; 62 commid_1= comm_ids[1]; 63 commid_2= comm_ids[2]; 64 commid_3 = comm_ids[3]; 65 commid_4 = comm_ids[4]; 66 67 } 68 69 74 public int getId() { 75 return this.id; 76 } 77 78 83 protected void setId(int id) { 84 this.id = id; 85 } 86 87 92 public int getAddBookId() { 93 return this.addbook_id; 94 } 95 96 101 protected void setAddBookId(int id) { 102 this.addbook_id = id; 103 } 104 105 106 111 public String getLastName() { 112 return this.last_name; 113 } 114 115 120 public void setLastName(String last_name) { 121 this.last_name = last_name; 122 } 123 124 129 public String getFirstName() { 130 return this.first_name; 131 } 132 133 138 public void setFirstName(String first_name) { 139 this.first_name = first_name; 140 } 141 142 147 public String getCivilTitle() { 148 return this.civil_title; 149 } 150 151 156 public void setCivilTitle(String civil_title) { 157 this.civil_title = civil_title; 158 } 159 160 165 public String getProfTitle() { 166 return this.prof_title; 167 } 168 169 174 public void setProfTitle(String prof_title) { 175 this.prof_title = prof_title; 176 } 177 178 183 public String getCompany() { 184 return this.company; 185 } 186 187 192 public void setCompany(String company) { 193 this.company = company; 194 } 195 196 201 public String getAddress1() { 202 return this.address1; 203 } 204 205 210 public void setAddress1(String address1) { 211 this.address1 = address1; 212 } 213 214 219 public String getAddress2() { 220 return this.address2; 221 } 222 223 228 public void setAddress2(String address2) { 229 this.address2 = address2; 230 } 231 232 237 public String getCity() { 238 return this.city; 239 } 240 241 246 public void setCity(String city) { 247 this.city = city; 248 } 249 250 255 public String getZip() { 256 return this.zip; 257 } 258 259 264 public void setZip(String zip) { 265 this.zip = zip; 266 } 267 268 273 public String getState() { 274 return this.state; 275 } 276 277 282 public void setState(String state) { 283 this.state = state; 284 } 285 286 291 public String getCountry() { 292 return this.country; 293 } 294 295 300 public void setCountry(String country) { 301 this.country = country; 302 } 303 304 309 public int getCategory() { 310 return this.category; 311 } 312 313 318 public void setCategory(int category) { 319 this.category = category; 320 } 321 322 327 public String getNotes() { 328 return this.notes; 329 } 330 331 336 public void setNotes(String notes) { 337 this.notes = notes; 338 } 339 340 346 public void setNumber(int i, int id, String value) { 347 this.comm_ids[i] = id; 348 this.comm_values[i] = value; 349 } 350 351 356 public int[] getNumbersIds() { 357 return this.comm_ids; 358 } 359 public void setNumbersIds(int [] a) { 360 for(int i=0; i<a.length;i++) 361 this.comm_ids[i]= a[i]; 362 } 363 364 369 public String [] getNumbersValues() { 370 return this.comm_values; 371 } 372 public void setNumbersValues(String [] a) { 373 for(int i=0; i<a.length;i++) 374 this.comm_values[i]= a[i]; 375 } 376 377 382 public boolean isCorrect() { 383 384 if (!this.last_name.equals("")) { 385 return true; 386 } 387 if (!this.first_name.equals("")) { 388 return true; 389 } 390 if (!this.company.equals("")) { 391 this.last_name = this.company; 392 this.civil_title = "Company"; 393 return true; 394 } 395 return false; 396 } 397 398 } 399 | Popular Tags |