1 37 38 package com.sun.j2ee.blueprints.consumerwebsite; 39 40 import java.io.Serializable ; 41 42 import com.sun.j2ee.blueprints.customer.Address; 44 import com.sun.j2ee.blueprints.customer.ContactInformation; 45 import com.sun.j2ee.blueprints.customer.Account; 46 47 50 public class CustomerBean implements Serializable { 51 52 53 private String userId = null; 54 private String streetName1; 55 private String streetName2; 56 private String city; 57 private String state; 58 private String zipCode; 59 private String country; 60 private String telephone; 61 private String email; 62 private Address address; 63 private String familyName; 64 private String givenName; 65 66 67 public CustomerBean(Account acct) { 68 this.userId = acct.getUserId(); 69 70 this.streetName1 = acct.getContactInformation().getAddress().getStreetName1(); 71 this.streetName2 = acct.getContactInformation().getAddress().getStreetName2(); 72 this.city = acct.getContactInformation().getAddress().getCity(); 73 this.state = acct.getContactInformation().getAddress().getState(); 74 this.zipCode = acct.getContactInformation().getAddress().getZipCode(); 75 this.country = acct.getContactInformation().getAddress().getCountry(); 76 77 this.givenName = acct.getContactInformation().getGivenName(); 78 this.familyName = acct.getContactInformation().getFamilyName(); 79 this.email = acct.getContactInformation().getEMail(); 80 this.telephone = acct.getContactInformation().getTelephone(); 81 } 82 83 public CustomerBean(String userId, String streetName1, String streetName2, 84 String city, String state, String zipCode, 85 String country, String familyName, String givenName, 86 String telephone, String email) { 87 this.userId = userId; 88 this.streetName1 = streetName1; 89 this.streetName2 = streetName2; 90 this.city = city; 91 this.state = state; 92 this.zipCode = zipCode; 93 this.country = country; 94 this.givenName = givenName; 95 this.familyName = familyName; 96 this.email = email; 97 this.telephone = telephone; 98 } 99 100 102 public String getUserId() { 103 return userId; 104 } 105 106 public String getStreetName1() { 107 return streetName1; 108 } 109 110 public String getStreetName2() { 111 return streetName2; 112 } 113 114 public String getCity() { 115 return city; 116 } 117 118 public String getState() { 119 return state; 120 } 121 122 public String getCountry() { 123 return country; 124 } 125 126 public String getZipCode() { 127 return zipCode; 128 } 129 130 public String getGivenName(){ 131 return givenName; 132 } 133 134 public String getFamilyName(){ 135 return familyName; 136 } 137 138 public String getEmail(){ 139 return email; 140 } 141 142 public String getTelephone(){ 143 return telephone; 144 } 145 146 147 149 public void setUserId(String userId) { 150 this.userId = userId; 151 } 152 153 public void setStreetName1(String streetName1) { 154 this.streetName1 = streetName1; 155 } 156 157 public void setStreetName2(String streetName2) { 158 this.streetName2 = streetName2; 159 } 160 161 public void setCity(String city) { 162 this.city = city; 163 } 164 165 public void setState(String state) { 166 this.state = state; 167 } 168 169 public void setCountry(String country) { 170 this.country = country; 171 } 172 173 public void setZipCode(String zipCode) { 174 this.zipCode = zipCode; 175 } 176 177 public void setGivenName(String givenName){ 178 this.givenName = givenName; 179 } 180 181 public void setFamilyName(String familyName){ 182 this.familyName = familyName; 183 } 184 185 public void setEmail(String email){ 186 this.email = email; 187 } 188 189 public void setTelephone(String telephone){ 190 this.telephone = telephone; 191 } 192 193 public String toString() { 194 String space = " "; 195 String ret = getUserId() + space + getStreetName1() + space + getStreetName2() + space + getCity() + space + getState() + space + getCountry() + space + getZipCode() + space + getGivenName() + space + getFamilyName() + space + getEmail() + space + getTelephone() + "\n"; 196 197 return ret; 198 } 199 200 } 201 | Popular Tags |