-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.java
More file actions
53 lines (40 loc) · 944 Bytes
/
Copy pathExample.java
File metadata and controls
53 lines (40 loc) · 944 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package builder;
/**
* Created by sanfen on 2016/12/26.
*
*
*/
public class Example {
private String date;
private String name;
private Example(){
}
private Example(String date, String name) {
this.date = date;
this.name = name;
}
public static class Builder {
private String date = "";
private String name = "";
public Builder() {
}
public Builder(String date, String name) {
this.date = date;
this.name = name;
}
public Builder setDate(String date) {
this.date = date;
return this;
}
public Builder setName(String name) {
this.name = name;
return this;
}
public Example builder(){
return new Example(date, name);
}
}
public Builder reBuilder(){
return new Builder(date, name);
}
}