1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
@ToString
public class Phone {
private String cpu;
private String screen;
private Phone(Builder builder) {
cpu = builder.cpu;
screen = builder.screen;
}
public String getCpu() {
return cpu;
}
public void setCpu(String cpu) {
this.cpu = cpu;
}
public String getScreen() {
return screen;
}
public void setScreen(String screen) {
this.screen = screen;
}
public static final class Builder {
private String cpu;
private String screen;
public Builder() {
}
public Builder cpu(String val) {
cpu = val;
return this;
}
public Builder screen(String val) {
screen = val;
return this;
}
public Phone build() {
return new Phone(this);
}
}
}
|