aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/BuilderSingularNullBehavior2.java
blob: e70877bf73d1d1721d72fec3cb1fb042146f4441 (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
import java.util.List;
class BuilderSingularNullBehavior2 {
	private List<String> locations;
	@java.lang.SuppressWarnings("all")
	BuilderSingularNullBehavior2(final List<String> locations) {
		this.locations = locations;
	}
	@java.lang.SuppressWarnings("all")
	public static class BuilderSingularNullBehavior2Builder {
		@java.lang.SuppressWarnings("all")
		private java.util.ArrayList<String> locations;
		@java.lang.SuppressWarnings("all")
		BuilderSingularNullBehavior2Builder() {
		}
		@org.springframework.lang.NonNull
		@java.lang.SuppressWarnings("all")
		public BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder location(final String location) {
			if (this.locations == null) this.locations = new java.util.ArrayList<String>();
			this.locations.add(location);
			return this;
		}
		@org.springframework.lang.NonNull
		@java.lang.SuppressWarnings("all")
		public BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder locations(@org.springframework.lang.NonNull final java.util.Collection<? extends String> locations) {
			java.util.Objects.requireNonNull(locations, "locations cannot be null");
			if (this.locations == null) this.locations = new java.util.ArrayList<String>();
			this.locations.addAll(locations);
			return this;
		}
		@org.springframework.lang.NonNull
		@java.lang.SuppressWarnings("all")
		public BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder clearLocations() {
			if (this.locations != null) this.locations.clear();
			return this;
		}
		@org.springframework.lang.NonNull
		@java.lang.SuppressWarnings("all")
		public BuilderSingularNullBehavior2 build() {
			java.util.List<String> locations;
			switch (this.locations == null ? 0 : this.locations.size()) {
			case 0: 
				locations = java.util.Collections.emptyList();
				break;
			case 1: 
				locations = java.util.Collections.singletonList(this.locations.get(0));
				break;
			default: 
				locations = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.locations));
			}
			return new BuilderSingularNullBehavior2(locations);
		}
		@org.springframework.lang.NonNull
		@java.lang.Override
		@java.lang.SuppressWarnings("all")
		public java.lang.String toString() {
			return "BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder(locations=" + this.locations + ")";
		}
	}
	@org.springframework.lang.NonNull
	@java.lang.SuppressWarnings("all")
	public static BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder builder() {
		return new BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder();
	}
}