您好,登錄后才能下訂單哦!
Java代碼
/**
* Created by baixiaobin
*/
public class User {
private final int id;
private final String name;
private final String sex;
private final String des;
public int getId() {
return id;
}
public String getName() {
return name;
}
public String getSex() {
return sex;
}
public String getDes() {
return des;
}
public static class Builder {
private final int id;
private final String name;
private String sex;
private String des;
public User build() { 下載
return new User(this);
}
/**
* id 主鍵id
* name 名稱
*/
public Builder(int id, String name) {
this.id = id;
this.name = name;
}
public Builder sex(String sex) {
this.sex = sex;
return this;
}
public Builder des(String des) {
this.des = des;
return this;
}
}
private User(Builder builder) {
this.id = builder.id;
this.name = builder.name;
this.des = builder.des;
this.sex = builder.sex;
}
}
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。