-
Notifications
You must be signed in to change notification settings - Fork 637
/
BuilderConstructorException.java
41 lines (32 loc) · 1 KB
/
BuilderConstructorException.java
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
class Exception {
}
public class BuilderConstructorException {
private int i;
public BuilderConstructorException(int i) throws Exception {
System.out.println("sss");
}
public static void main(String[] args) {
try {
builder().i(2).build();
} catch (Exception ignore) {
}
}
public static BuilderConstructorExceptionBuilder builder() {
return new BuilderConstructorExceptionBuilder();
}
public static class BuilderConstructorExceptionBuilder {
private int i;
BuilderConstructorExceptionBuilder() {
}
public BuilderConstructorExceptionBuilder i(int i) {
this.i = i;
return this;
}
public BuilderConstructorException build() throws Exception {
return new BuilderConstructorException(i);
}
public String toString() {
return "BuilderConstructorException.BuilderConstructorExceptionBuilder(i=" + this.i + ")";
}
}
}