aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/CheckerFrameworkSuperBuilder.java
blob: 919a3e33f14cd320c89e880eefd18690da9d3cbe (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
217
218
// skip-idempotent
import java.util.List;
class CheckerFrameworkSuperBuilder {
	public static class Parent {
		int x;
		int y;
		int z;
		List<String> names;
		@java.lang.SuppressWarnings("all")
		private static int $default$x() {
			return 5;
		}
		@java.lang.SuppressWarnings("all")
		public static abstract class ParentBuilder<C extends CheckerFrameworkSuperBuilder.Parent, B extends CheckerFrameworkSuperBuilder.Parent.ParentBuilder<C, B>> {
			@java.lang.SuppressWarnings("all")
			private boolean x$set;
			@java.lang.SuppressWarnings("all")
			private int x$value;
			@java.lang.SuppressWarnings("all")
			private int y;
			@java.lang.SuppressWarnings("all")
			private int z;
			@java.lang.SuppressWarnings("all")
			private java.util.ArrayList<String> names;
			@org.checkerframework.common.returnsreceiver.qual.This
			@org.checkerframework.dataflow.qual.Pure
			@java.lang.SuppressWarnings("all")
			protected abstract B self();
			@org.checkerframework.dataflow.qual.SideEffectFree
			@java.lang.SuppressWarnings("all")
			public abstract C build(CheckerFrameworkSuperBuilder.Parent.@org.checkerframework.checker.calledmethods.qual.CalledMethods({"y", "z"}) ParentBuilder<C, B> this);
			/**
			 * @return {@code this}.
			 */
			@org.checkerframework.common.returnsreceiver.qual.This
			@java.lang.SuppressWarnings("all")
			public B x(CheckerFrameworkSuperBuilder.Parent.@org.checkerframework.checker.calledmethods.qual.NotCalledMethods("x") ParentBuilder<C, B> this, final int x) {
				this.x$value = x;
				x$set = true;
				return self();
			}
			/**
			 * @return {@code this}.
			 */
			@org.checkerframework.common.returnsreceiver.qual.This
			@java.lang.SuppressWarnings("all")
			public B y(CheckerFrameworkSuperBuilder.Parent.@org.checkerframework.checker.calledmethods.qual.NotCalledMethods("y") ParentBuilder<C, B> this, final int y) {
				this.y = y;
				return self();
			}
			/**
			 * @return {@code this}.
			 */
			@org.checkerframework.common.returnsreceiver.qual.This
			@java.lang.SuppressWarnings("all")
			public B z(CheckerFrameworkSuperBuilder.Parent.@org.checkerframework.checker.calledmethods.qual.NotCalledMethods("z") ParentBuilder<C, B> this, final int z) {
				this.z = z;
				return self();
			}
			@org.checkerframework.common.returnsreceiver.qual.This
			@java.lang.SuppressWarnings("all")
			public B name(final String name) {
				if (this.names == null) this.names = new java.util.ArrayList<String>();
				this.names.add(name);
				return self();
			}
			@org.checkerframework.common.returnsreceiver.qual.This
			@java.lang.SuppressWarnings("all")
			public B names(final java.util.Collection<? extends String> names) {
				if (names == null) {
					throw new java.lang.NullPointerException("names cannot be null");
				}
				if (this.names == null) this.names = new java.util.ArrayList<String>();
				this.names.addAll(names);
				return self();
			}
			@org.checkerframework.common.returnsreceiver.qual.This
			@java.lang.SuppressWarnings("all")
			public B clearNames() {
				if (this.names != null) this.names.clear();
				return self();
			}
			@org.checkerframework.dataflow.qual.SideEffectFree
			@java.lang.Override
			@java.lang.SuppressWarnings("all")
			public java.lang.String toString() {
				return "CheckerFrameworkSuperBuilder.Parent.ParentBuilder(x$value=" + this.x$value + ", y=" + this.y + ", z=" + this.z + ", names=" + this.names + ")";
			}
		}
		@java.lang.SuppressWarnings("all")
		private static final class ParentBuilderImpl extends CheckerFrameworkSuperBuilder.Parent.ParentBuilder<CheckerFrameworkSuperBuilder.Parent, CheckerFrameworkSuperBuilder.Parent.ParentBuilderImpl> {
			@java.lang.SuppressWarnings("all")
			private ParentBuilderImpl() {
			}
			@java.lang.Override
			@org.checkerframework.common.returnsreceiver.qual.This
			@org.checkerframework.dataflow.qual.Pure
			@java.lang.SuppressWarnings("all")
			protected CheckerFrameworkSuperBuilder.Parent.ParentBuilderImpl self() {
				return this;
			}
			@org.checkerframework.dataflow.qual.SideEffectFree
			@java.lang.Override
			@java.lang.SuppressWarnings("all")
			public CheckerFrameworkSuperBuilder.Parent build(CheckerFrameworkSuperBuilder.Parent.@org.checkerframework.checker.calledmethods.qual.CalledMethods({"y", "z"}) ParentBuilderImpl this) {
				return new CheckerFrameworkSuperBuilder.Parent(this);
			}
		}
		@org.checkerframework.dataflow.qual.SideEffectFree
		@java.lang.SuppressWarnings("all")
		protected Parent(final CheckerFrameworkSuperBuilder.Parent.ParentBuilder<?, ?> b) {
			if (b.x$set) this.x = b.x$value;
			 else this.x = CheckerFrameworkSuperBuilder.Parent.$default$x();
			this.y = b.y;
			this.z = b.z;
			java.util.List<String> names;
			switch (b.names == null ? 0 : b.names.size()) {
			case 0: 
				names = java.util.Collections.emptyList();
				break;
			case 1: 
				names = java.util.Collections.singletonList(b.names.get(0));
				break;
			default: 
				names = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.names));
			}
			this.names = names;
		}
		@org.checkerframework.dataflow.qual.SideEffectFree
		@java.lang.SuppressWarnings("all")
		public static CheckerFrameworkSuperBuilder.Parent.ParentBuilder<?, ?> builder() {
			return new CheckerFrameworkSuperBuilder.Parent.ParentBuilderImpl();
		}
	}
	public static class ZChild extends Parent {
		int a;
		int b;
		@java.lang.SuppressWarnings("all")
		private static int $default$a() {
			return 1;
		}
		@java.lang.SuppressWarnings("all")
		public static abstract class ZChildBuilder<C extends CheckerFrameworkSuperBuilder.ZChild, B extends CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
			@java.lang.SuppressWarnings("all")
			private boolean a$set;
			@java.lang.SuppressWarnings("all")
			private int a$value;
			@java.lang.SuppressWarnings("all")
			private int b;
			@java.lang.Override
			@org.checkerframework.common.returnsreceiver.qual.This
			@org.checkerframework.dataflow.qual.Pure
			@java.lang.SuppressWarnings("all")
			protected abstract B self();
			@org.checkerframework.dataflow.qual.SideEffectFree
			@java.lang.Override
			@java.lang.SuppressWarnings("all")
			public abstract C build(CheckerFrameworkSuperBuilder.ZChild.@org.checkerframework.checker.calledmethods.qual.CalledMethods("b") ZChildBuilder<C, B> this);
			/**
			 * @return {@code this}.
			 */
			@org.checkerframework.common.returnsreceiver.qual.This
			@java.lang.SuppressWarnings("all")
			public B a(CheckerFrameworkSuperBuilder.ZChild.@org.checkerframework.checker.calledmethods.qual.NotCalledMethods("a") ZChildBuilder<C, B> this, final int a) {
				this.a$value = a;
				a$set = true;
				return self();
			}
			/**
			 * @return {@code this}.
			 */
			@org.checkerframework.common.returnsreceiver.qual.This
			@java.lang.SuppressWarnings("all")
			public B b(CheckerFrameworkSuperBuilder.ZChild.@org.checkerframework.checker.calledmethods.qual.NotCalledMethods("b") ZChildBuilder<C, B> this, final int b) {
				this.b = b;
				return self();
			}
			@org.checkerframework.dataflow.qual.SideEffectFree
			@java.lang.Override
			@java.lang.SuppressWarnings("all")
			public java.lang.String toString() {
				return "CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder(super=" + super.toString() + ", a$value=" + this.a$value + ", b=" + this.b + ")";
			}
		}
		@java.lang.SuppressWarnings("all")
		private static final class ZChildBuilderImpl extends CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<CheckerFrameworkSuperBuilder.ZChild, CheckerFrameworkSuperBuilder.ZChild.ZChildBuilderImpl> {
			@java.lang.SuppressWarnings("all")
			private ZChildBuilderImpl() {
			}
			@java.lang.Override
			@org.checkerframework.common.returnsreceiver.qual.This
			@org.checkerframework.dataflow.qual.Pure
			@java.lang.SuppressWarnings("all")
			protected CheckerFrameworkSuperBuilder.ZChild.ZChildBuilderImpl self() {
				return this;
			}
			@org.checkerframework.dataflow.qual.SideEffectFree
			@java.lang.Override
			@java.lang.SuppressWarnings("all")
			public CheckerFrameworkSuperBuilder.ZChild build(CheckerFrameworkSuperBuilder.ZChild.@org.checkerframework.checker.calledmethods.qual.CalledMethods("b") ZChildBuilderImpl this) {
				return new CheckerFrameworkSuperBuilder.ZChild(this);
			}
		}
		@org.checkerframework.dataflow.qual.SideEffectFree
		@java.lang.SuppressWarnings("all")
		protected ZChild(final CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<?, ?> b) {
			super(b);
			if (b.a$set) this.a = b.a$value;
			 else this.a = CheckerFrameworkSuperBuilder.ZChild.$default$a();
			this.b = b.b;
		}
		@org.checkerframework.dataflow.qual.SideEffectFree
		@java.lang.SuppressWarnings("all")
		public static CheckerFrameworkSuperBuilder.ZChild.ZChildBuilder<?, ?> builder() {
			return new CheckerFrameworkSuperBuilder.ZChild.ZChildBuilderImpl();
		}
	}
}