-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathTaskBuilder.java
117 lines (107 loc) · 2.74 KB
/
TaskBuilder.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package samples;
import javaxfake.annotation.Generated;
import net.karneim.pojobuilder.GwtIncompatible;
@Generated("PojoBuilder")
public class TaskBuilder
implements Cloneable {
protected TaskBuilder self;
protected String value$name$java$lang$String;
protected boolean isSet$name$java$lang$String;
protected User value$assignee$samples$User;
protected boolean isSet$assignee$samples$User;
protected String value$description$java$lang$String;
protected boolean isSet$description$java$lang$String;
/**
* Factory Method to construct a TaskBuilder
*
* @return a new TaskBuilder
*/
public static TaskBuilder task() {
return new TaskBuilder();
}
/**
* Creates a new {@link TaskBuilder}.
*/
public TaskBuilder() {
self = (TaskBuilder)this;
}
/**
* Sets the default value for the name property.
*
* @param value the default value
* @return this builder
*/
public TaskBuilder withName(String value) {
this.value$name$java$lang$String = value;
this.isSet$name$java$lang$String = true;
return self;
}
/**
* Sets the default value for the assignee property.
*
* @param value the default value
* @return this builder
*/
public TaskBuilder withAssignee(User value) {
this.value$assignee$samples$User = value;
this.isSet$assignee$samples$User = true;
return self;
}
/**
* Sets the default value for the description property.
*
* @param value the default value
* @return this builder
*/
public TaskBuilder withDescription(String value) {
this.value$description$java$lang$String = value;
this.isSet$description$java$lang$String = true;
return self;
}
/**
* Returns a clone of this builder.
*
* @return the clone
*/
@Override
@GwtIncompatible
public Object clone() {
try {
TaskBuilder result = (TaskBuilder)super.clone();
result.self = result;
return result;
} catch (CloneNotSupportedException e) {
throw new InternalError(e.getMessage());
}
}
/**
* Returns a clone of this builder.
*
* @return the clone
*/
@GwtIncompatible
public TaskBuilder but() {
return (TaskBuilder)clone();
}
/**
* Creates a new {@link Task} based on this builder's settings.
*
* @return the created Task
*/
public Task build() {
try {
Task result = new Task(value$name$java$lang$String);
if (isSet$assignee$samples$User) {
result.setAssignee(value$assignee$samples$User);
}
if (isSet$description$java$lang$String) {
result.setDescription(value$description$java$lang$String);
}
return result;
} catch (RuntimeException ex) {
throw ex;
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}