-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCalPizza.java
More file actions
34 lines (27 loc) Β· 755 Bytes
/
Copy pathCalPizza.java
File metadata and controls
34 lines (27 loc) Β· 755 Bytes
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
package Chapter2.Day2;
public class CalPizza extends Pizza {
private final boolean sourceInside;
public static class Builder extends Pizza.Builder<Builder> {
private boolean sourceInside = false;
public Builder sourceGo() {
this.sourceInside = true;
return this;
}
public Builder sourceNo() {
this.sourceInside = false;
return this;
}
@Override
public CalPizza build() {
return new CalPizza(this);
}
@Override
protected Builder self() {
return this;
}
}
private CalPizza(Builder builder) {
super(builder);
this.sourceInside = builder.sourceInside;
}
}