aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/BuilderWithDeprecated.java
blob: cd88752987ffee17857e0f8eef79cece3850b025 (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
import com.google.common.collect.ImmutableList;
public class BuilderWithDeprecated {
	/**
	 * @deprecated
	 */
	String dep1;
	@Deprecated
	int dep2;
	@Deprecated
	java.util.List<String> strings;
	@Deprecated
	ImmutableList<Integer> numbers;
	@java.lang.SuppressWarnings("all")
	BuilderWithDeprecated(final String dep1, final int dep2, final java.util.List<String> strings, final ImmutableList<Integer> numbers) {
		this.dep1 = dep1;
		this.dep2 = dep2;
		this.strings = strings;
		this.numbers = numbers;
	}
	@java.lang.SuppressWarnings("all")
	public static class BuilderWithDeprecatedBuilder {
		@java.lang.SuppressWarnings("all")
		private String dep1;
		@java.lang.SuppressWarnings("all")
		private int dep2;
		@java.lang.SuppressWarnings("all")
		private java.util.ArrayList<String> strings;
		@java.lang.SuppressWarnings("all")
		private com.google.common.collect.ImmutableList.Builder<Integer> numbers;
		@java.lang.SuppressWarnings("all")
		BuilderWithDeprecatedBuilder() {
		}
		@java.lang.Deprecated
		@java.lang.SuppressWarnings("all")
		public BuilderWithDeprecatedBuilder dep1(final String dep1) {
			this.dep1 = dep1;
			return this;
		}
		@java.lang.Deprecated
		@java.lang.SuppressWarnings("all")
		public BuilderWithDeprecatedBuilder dep2(final int dep2) {
			this.dep2 = dep2;
			return this;
		}
		@java.lang.Deprecated
		@java.lang.SuppressWarnings("all")
		public BuilderWithDeprecatedBuilder string(final String string) {
			if (this.strings == null) this.strings = new java.util.ArrayList<String>();
			this.strings.add(string);
			return this;
		}
		@java.lang.Deprecated
		@java.lang.SuppressWarnings("all")
		public BuilderWithDeprecatedBuilder strings(final java.util.Collection<? extends String> strings) {
			if (this.strings == null) this.strings = new java.util.ArrayList<String>();
			this.strings.addAll(strings);
			return this;
		}
		@java.lang.Deprecated
		@java.lang.SuppressWarnings("all")
		public BuilderWithDeprecatedBuilder clearStrings() {
			if (this.strings != null) this.strings.clear();
			return this;
		}
		@java.lang.Deprecated
		@java.lang.SuppressWarnings("all")
		public BuilderWithDeprecatedBuilder number(final Integer number) {
			if (this.numbers == null) this.numbers = com.google.common.collect.ImmutableList.builder();
			this.numbers.add(number);
			return this;
		}
		@java.lang.Deprecated
		@java.lang.SuppressWarnings("all")
		public BuilderWithDeprecatedBuilder numbers(final java.lang.Iterable<? extends Integer> numbers) {
			if (this.numbers == null) this.numbers = com.google.common.collect.ImmutableList.builder();
			this.numbers.addAll(numbers);
			return this;
		}
		@java.lang.Deprecated
		@java.lang.SuppressWarnings("all")
		public BuilderWithDeprecatedBuilder clearNumbers() {
			this.numbers = null;
			return this;
		}
		@java.lang.SuppressWarnings("all")
		public BuilderWithDeprecated build() {
			java.util.List<String> strings;
			switch (this.strings == null ? 0 : this.strings.size()) {
			case 0: 
				strings = java.util.Collections.emptyList();
				break;
			case 1: 
				strings = java.util.Collections.singletonList(this.strings.get(0));
				break;
			default: 
				strings = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.strings));
			}
			com.google.common.collect.ImmutableList<Integer> numbers = this.numbers == null ? com.google.common.collect.ImmutableList.<Integer>of() : this.numbers.build();
			return new BuilderWithDeprecated(dep1, dep2, strings, numbers);
		}
		@java.lang.Override
		@java.lang.SuppressWarnings("all")
		public java.lang.String toString() {
			return "BuilderWithDeprecated.BuilderWithDeprecatedBuilder(dep1=" + this.dep1 + ", dep2=" + this.dep2 + ", strings=" + this.strings + ", numbers=" + this.numbers + ")";
		}
	}
	@java.lang.SuppressWarnings("all")
	public static BuilderWithDeprecatedBuilder builder() {
		return new BuilderWithDeprecatedBuilder();
	}
}