aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/BuilderWithToBuilder.java
blob: eb61a6db3b2f5f3509ffdc959544b92267fb4eb3 (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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
import java.util.List;
class BuilderWithToBuilder<T> {
	private String mOne;
	private String mTwo;
	private T foo;
	private List<T> bars;
	public static <K> K rrr(BuilderWithToBuilder<K> x) {
		return x.foo;
	}
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	BuilderWithToBuilder(final String one, final String two, final T foo, final List<T> bars) {
		this.mOne = one;
		this.mTwo = two;
		this.foo = foo;
		this.bars = bars;
	}
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public static class BuilderWithToBuilderBuilder<T> {
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		private String one;
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		private String two;
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		private T foo;
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		private java.util.ArrayList<T> bars;
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		BuilderWithToBuilderBuilder() {
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public BuilderWithToBuilderBuilder<T> one(final String one) {
			this.one = one;
			return this;
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public BuilderWithToBuilderBuilder<T> two(final String two) {
			this.two = two;
			return this;
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public BuilderWithToBuilderBuilder<T> foo(final T foo) {
			this.foo = foo;
			return this;
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public BuilderWithToBuilderBuilder<T> bar(final T bar) {
			if (this.bars == null) this.bars = new java.util.ArrayList<T>();
			this.bars.add(bar);
			return this;
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public BuilderWithToBuilderBuilder<T> bars(final java.util.Collection<? extends T> bars) {
			if (this.bars == null) this.bars = new java.util.ArrayList<T>();
			this.bars.addAll(bars);
			return this;
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public BuilderWithToBuilder<T> build() {
			java.util.List<T> bars;
			switch (this.bars == null ? 0 : this.bars.size()) {
			case 0: 
				bars = java.util.Collections.emptyList();
				break;
			case 1: 
				bars = java.util.Collections.singletonList(this.bars.get(0));
				break;
			default: 
				bars = java.util.Collections.unmodifiableList(new java.util.ArrayList<T>(this.bars));
			}
			return new BuilderWithToBuilder<T>(one, two, foo, bars);
		}
		@java.lang.Override
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public java.lang.String toString() {
			return "BuilderWithToBuilder.BuilderWithToBuilderBuilder(one=" + this.one + ", two=" + this.two + ", foo=" + this.foo + ", bars=" + this.bars + ")";
		}
	}
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public static <T> BuilderWithToBuilderBuilder<T> builder() {
		return new BuilderWithToBuilderBuilder<T>();
	}
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public BuilderWithToBuilderBuilder<T> toBuilder() {
		return new BuilderWithToBuilderBuilder<T>().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this)).bars(this.bars);
	}
}
class ConstructorWithToBuilder<T> {
	private String mOne;
	private String mTwo;
	private T foo;
	@lombok.Singular
	private List<T> bars;
	public ConstructorWithToBuilder(String mOne, T bar) {
	}
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public static class ConstructorWithToBuilderBuilder<T> {
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		private String mOne;
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		private T bar;
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		ConstructorWithToBuilderBuilder() {
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public ConstructorWithToBuilderBuilder<T> mOne(final String mOne) {
			this.mOne = mOne;
			return this;
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public ConstructorWithToBuilderBuilder<T> bar(final T bar) {
			this.bar = bar;
			return this;
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public ConstructorWithToBuilder<T> build() {
			return new ConstructorWithToBuilder<T>(mOne, bar);
		}
		@java.lang.Override
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public java.lang.String toString() {
			return "ConstructorWithToBuilder.ConstructorWithToBuilderBuilder(mOne=" + this.mOne + ", bar=" + this.bar + ")";
		}
	}
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public static <T> ConstructorWithToBuilderBuilder<T> builder() {
		return new ConstructorWithToBuilderBuilder<T>();
	}
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public ConstructorWithToBuilderBuilder<T> toBuilder() {
		return new ConstructorWithToBuilderBuilder<T>().mOne(this.mOne).bar(this.foo);
	}
}
class StaticWithToBuilder<T, K> {
	private String mOne;
	private String mTwo;
	private T foo;
	private K bar;
	@lombok.Singular
	private List<T> bars;
	public static <Z> StaticWithToBuilder<Z, String> test(String mOne, Z bar) {
		return new StaticWithToBuilder<Z, String>();
	}
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public static class StaticWithToBuilderBuilder<Z> {
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		private String mOne;
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		private Z bar;
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		StaticWithToBuilderBuilder() {
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public StaticWithToBuilderBuilder<Z> mOne(final String mOne) {
			this.mOne = mOne;
			return this;
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public StaticWithToBuilderBuilder<Z> bar(final Z bar) {
			this.bar = bar;
			return this;
		}
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public StaticWithToBuilder build() {
			return StaticWithToBuilder.<Z>test(mOne, bar);
		}
		@java.lang.Override
		@java.lang.SuppressWarnings("all")
		@javax.annotation.Generated("lombok")
		public java.lang.String toString() {
			return "StaticWithToBuilder.StaticWithToBuilderBuilder(mOne=" + this.mOne + ", bar=" + this.bar + ")";
		}
	}
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public static <Z> StaticWithToBuilderBuilder<Z> builder() {
		return new StaticWithToBuilderBuilder<Z>();
	}
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public StaticWithToBuilderBuilder<T> toBuilder() {
		return new StaticWithToBuilderBuilder<T>().mOne(this.mOne).bar(this.foo);
	}
}