1 17 18 package org.apache.commons.digester; 19 20 21 24 25 26 public class Address { 27 28 public Address() { 29 this("My Street", "My City", "US", "MyZip"); 30 } 31 32 public Address(String street, String city, String state, String zipCode) { 33 super(); 34 setStreet(street); 35 setCity(city); 36 setState(state); 37 setZipCode(zipCode); 38 } 39 40 private String city = null; 41 42 public String getCity() { 43 return (this.city); 44 } 45 46 public void setCity(String city) { 47 this.city = city; 48 } 49 50 private String state = null; 51 52 public String getState() { 53 return (this.state); 54 } 55 56 public void setState(String state) { 57 this.state = state; 58 } 59 60 private String street = null; 61 62 public String getStreet() { 63 return (this.street); 64 } 65 66 public void setStreet(String street) { 67 this.street = street; 68 } 69 70 private String type = null; 71 72 public String getType() { 73 return (this.type); 74 } 75 76 public void setType(String type) { 77 this.type = type; 78 } 79 80 private String zipCode = null; 81 82 public String getZipCode() { 83 return (this.zipCode); 84 } 85 86 public void setZipCode(String zipCode) { 87 this.zipCode = zipCode; 88 } 89 90 public void setEmployee(Employee employee) { 91 employee.addAddress(this); 92 } 93 94 public String toString() { 95 StringBuffer sb = new StringBuffer ("Address["); 96 sb.append("street="); 97 sb.append(street); 98 sb.append(", city="); 99 sb.append(city); 100 sb.append(", state="); 101 sb.append(state); 102 sb.append(", zipCode="); 103 sb.append(zipCode); 104 sb.append("]"); 105 return (sb.toString()); 106 } 107 108 } 109 | Popular Tags |