package edu.mama.ls16.homework;
// 地址划分为 省、市、区、其他,前3项通常可以下拉选择,也便于日后按区域统计
// 多数平台下单后地址不可改变,这里就不设set方法了
public class Consignee {
private String name;
private String mobile;
private String addrProvince;
private String addrCity;
private String addrDistrict;
private String addrOther;
public Consignee(String name, String mobile, String addrProvince, String addrCity, String addrDistrict, String addrOther) {<br /> this.name = name;<br /> this.mobile = mobile;<br /> this.addrProvince = addrProvince;<br /> this.addrCity = addrCity;<br /> this.addrDistrict = addrDistrict;<br /> this.addrOther = addrOther;<br /> }
public String getName() {<br /> return name;<br /> }
public String getMobile() {<br /> return mobile;<br /> }
public String getAddrProvince() {<br /> return addrProvince;<br /> }
public String getAddrCity() {<br /> return addrCity;<br /> }
public String getAddrDistrict() {<br /> return addrDistrict;<br /> }
public String getAddrOther() {<br /> return addrOther;<br /> }
public String getFullAddr()<br /> {<br /> return addrProvince+addrCity+addrDistrict+addrOther;<br /> }
//以sep为分隔符,将Consignee内容拼接成字符串<br /> public String toString(String sep) {<br /> StringBuilder sb=new StringBuilder();<br /> sb.append(this.name).append(sep).append(this.mobile).append(sep).append(getFullAddr());<br /> return sb.toString();<br /> }<br />}