-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathTextEmailBuilder.java
142 lines (131 loc) · 3.56 KB
/
TextEmailBuilder.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package samples;
import javaxfake.annotation.Generated;
import net.karneim.pojobuilder.GwtIncompatible;
@Generated("PojoBuilder")
public class TextEmailBuilder
implements Cloneable {
protected TextEmailBuilder self;
protected String value$from$java$lang$String;
protected boolean isSet$from$java$lang$String;
protected String[] value$recipients$java$lang$String$L;
protected boolean isSet$recipients$java$lang$String$L;
protected String value$subject$java$lang$String;
protected boolean isSet$subject$java$lang$String;
protected String value$body$java$lang$String;
protected boolean isSet$body$java$lang$String;
/**
* Creates a new {@link TextEmailBuilder}.
*/
public TextEmailBuilder() {
self = (TextEmailBuilder)this;
}
/**
* Sets the default value for the from property.
*
* @param value the default value
* @return this builder
*/
public TextEmailBuilder withFrom(String value) {
this.value$from$java$lang$String = value;
this.isSet$from$java$lang$String = true;
return self;
}
/**
* Sets the default value for the recipients property.
*
* @param value the default value
* @return this builder
*/
public TextEmailBuilder withRecipients(String... value) {
this.value$recipients$java$lang$String$L = value;
this.isSet$recipients$java$lang$String$L = true;
return self;
}
/**
* Sets the default value for the subject property.
*
* @param value the default value
* @return this builder
*/
public TextEmailBuilder withSubject(String value) {
this.value$subject$java$lang$String = value;
this.isSet$subject$java$lang$String = true;
return self;
}
/**
* Sets the default value for the body property.
*
* @param value the default value
* @return this builder
*/
public TextEmailBuilder withBody(String value) {
this.value$body$java$lang$String = value;
this.isSet$body$java$lang$String = true;
return self;
}
/**
* Returns a clone of this builder.
*
* @return the clone
*/
@Override
@GwtIncompatible
public Object clone() {
try {
TextEmailBuilder result = (TextEmailBuilder)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 TextEmailBuilder but() {
return (TextEmailBuilder)clone();
}
/**
* Copies the values from the given pojo into this builder.
*
* @param pojo
* @return this builder
*/
public TextEmailBuilder copy(TextEmail pojo) {
withFrom(pojo.getFrom());
withRecipients(pojo.getRecipients());
withSubject(pojo.getSubject());
withBody(pojo.getBody());
return self;
}
/**
* Creates a new {@link TextEmail} based on this builder's settings.
*
* @return the created TextEmail
*/
public TextEmail build() {
try {
TextEmail result = new TextEmail();
if (isSet$from$java$lang$String) {
result.setFrom(value$from$java$lang$String);
}
if (isSet$recipients$java$lang$String$L) {
result.setRecipients(value$recipients$java$lang$String$L);
}
if (isSet$subject$java$lang$String) {
result.setSubject(value$subject$java$lang$String);
}
if (isSet$body$java$lang$String) {
result.setBody(value$body$java$lang$String);
}
return result;
} catch (RuntimeException ex) {
throw ex;
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}