blob: 04c230516fac08ab458b71976026bb399dbd7722 (
plain)
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
|
class SuperBuilderWithPrefixes {
int mField;
int xOtherField;
java.util.List<String> mItems;
@java.lang.SuppressWarnings("all")
public static abstract class SuperBuilderWithPrefixesBuilder<C extends SuperBuilderWithPrefixes, B extends SuperBuilderWithPrefixes.SuperBuilderWithPrefixesBuilder<C, B>> {
@java.lang.SuppressWarnings("all")
private int field;
@java.lang.SuppressWarnings("all")
private int otherField;
@java.lang.SuppressWarnings("all")
private java.util.ArrayList<String> items;
/**
* @return {@code this}.
*/
@java.lang.SuppressWarnings("all")
public B field(final int field) {
this.field = field;
return self();
}
/**
* @return {@code this}.
*/
@java.lang.SuppressWarnings("all")
public B otherField(final int otherField) {
this.otherField = otherField;
return self();
}
@java.lang.SuppressWarnings("all")
public B item(final String item) {
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.add(item);
return self();
}
@java.lang.SuppressWarnings("all")
public B items(final java.util.Collection<? extends String> items) {
if (items == null) {
throw new java.lang.NullPointerException("items cannot be null");
}
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return self();
}
@java.lang.SuppressWarnings("all")
public B clearItems() {
if (this.items != null) this.items.clear();
return self();
}
@java.lang.SuppressWarnings("all")
protected abstract B self();
@java.lang.SuppressWarnings("all")
public abstract C build();
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString() {
return "SuperBuilderWithPrefixes.SuperBuilderWithPrefixesBuilder(field=" + this.field + ", otherField=" + this.otherField + ", items=" + this.items + ")";
}
}
@java.lang.SuppressWarnings("all")
private static final class SuperBuilderWithPrefixesBuilderImpl extends SuperBuilderWithPrefixes.SuperBuilderWithPrefixesBuilder<SuperBuilderWithPrefixes, SuperBuilderWithPrefixes.SuperBuilderWithPrefixesBuilderImpl> {
@java.lang.SuppressWarnings("all")
private SuperBuilderWithPrefixesBuilderImpl() {
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
protected SuperBuilderWithPrefixes.SuperBuilderWithPrefixesBuilderImpl self() {
return this;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public SuperBuilderWithPrefixes build() {
return new SuperBuilderWithPrefixes(this);
}
}
@java.lang.SuppressWarnings("all")
protected SuperBuilderWithPrefixes(final SuperBuilderWithPrefixes.SuperBuilderWithPrefixesBuilder<?, ?> b) {
this.mField = b.field;
this.xOtherField = b.otherField;
java.util.List<String> items;
switch (b.items == null ? 0 : b.items.size()) {
case 0:
items = java.util.Collections.emptyList();
break;
case 1:
items = java.util.Collections.singletonList(b.items.get(0));
break;
default:
items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
}
this.mItems = items;
}
@java.lang.SuppressWarnings("all")
public static SuperBuilderWithPrefixes.SuperBuilderWithPrefixesBuilder<?, ?> builder() {
return new SuperBuilderWithPrefixes.SuperBuilderWithPrefixesBuilderImpl();
}
}
|