aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/BuilderSingletonSets.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2015-01-11 22:38:22 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2015-01-11 22:38:22 +0100
commit6894fa31e888c19b879385b6fd852b7ff0b3d475 (patch)
tree986f437b90c891c0ceaf1a3b9fb5efa54cbc8a37 /test/transform/resource/after-delombok/BuilderSingletonSets.java
parent8bfd1a2767b2021b65be6d29fdb2a512be8fe05b (diff)
downloadlombok-6894fa31e888c19b879385b6fd852b7ff0b3d475.tar.gz
lombok-6894fa31e888c19b879385b6fd852b7ff0b3d475.tar.bz2
lombok-6894fa31e888c19b879385b6fd852b7ff0b3d475.zip
Set @Singularize code for javac improved, Map @Singularize added.
Diffstat (limited to 'test/transform/resource/after-delombok/BuilderSingletonSets.java')
-rw-r--r--test/transform/resource/after-delombok/BuilderSingletonSets.java128
1 files changed, 128 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/BuilderSingletonSets.java b/test/transform/resource/after-delombok/BuilderSingletonSets.java
new file mode 100644
index 00000000..1b71a56c
--- /dev/null
+++ b/test/transform/resource/after-delombok/BuilderSingletonSets.java
@@ -0,0 +1,128 @@
+import java.util.Set;
+import java.util.SortedSet;
+class BuilderSingletonSets<T> {
+ private Set<T> dangerMice;
+ private SortedSet<? extends Number> octopodes;
+ private Set rawSet;
+ private Set<String> stringSet;
+ @java.lang.SuppressWarnings("all")
+ BuilderSingletonSets(final Set<T> dangerMice, final SortedSet<? extends Number> octopodes, final Set rawSet, final Set<String> stringSet) {
+ this.dangerMice = dangerMice;
+ this.octopodes = octopodes;
+ this.rawSet = rawSet;
+ this.stringSet = stringSet;
+ }
+ @java.lang.SuppressWarnings("all")
+ public static class BuilderSingletonSetsBuilder<T> {
+ private java.util.ArrayList<T> dangerMice;
+ private java.util.ArrayList<Number> octopodes;
+ private java.util.ArrayList<java.lang.Object> rawSet;
+ private java.util.ArrayList<String> stringSet;
+ @java.lang.SuppressWarnings("all")
+ BuilderSingletonSetsBuilder() {
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingletonSetsBuilder<T> dangerMouse(final T dangerMouse) {
+ if (this.dangerMice == null) this.dangerMice = new java.util.ArrayList<T>();
+ this.dangerMice.add(dangerMouse);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingletonSetsBuilder<T> dangerMice(final java.util.Collection<? extends T> dangerMice) {
+ if (this.dangerMice == null) this.dangerMice = new java.util.ArrayList<T>();
+ this.dangerMice.addAll(dangerMice);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingletonSetsBuilder<T> octopus(final Number octopus) {
+ if (this.octopodes == null) this.octopodes = new java.util.ArrayList<Number>();
+ this.octopodes.add(octopus);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingletonSetsBuilder<T> octopodes(final java.util.Collection<? extends Number> octopodes) {
+ if (this.octopodes == null) this.octopodes = new java.util.ArrayList<Number>();
+ this.octopodes.addAll(octopodes);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingletonSetsBuilder<T> rawSet(final java.lang.Object rawSet) {
+ if (this.rawSet == null) this.rawSet = new java.util.ArrayList<java.lang.Object>();
+ this.rawSet.add(rawSet);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingletonSetsBuilder<T> rawSet(final java.util.Collection<?> rawSet) {
+ if (this.rawSet == null) this.rawSet = new java.util.ArrayList<java.lang.Object>();
+ this.rawSet.addAll(rawSet);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingletonSetsBuilder<T> stringSet(final String stringSet) {
+ if (this.stringSet == null) this.stringSet = new java.util.ArrayList<String>();
+ this.stringSet.add(stringSet);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingletonSetsBuilder<T> stringSet(final java.util.Collection<? extends String> stringSet) {
+ if (this.stringSet == null) this.stringSet = new java.util.ArrayList<String>();
+ this.stringSet.addAll(stringSet);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingletonSets<T> build() {
+ java.util.Set<T> dangerMice;
+ switch (this.dangerMice == null ? 0 : this.dangerMice.size()) {
+ case 0:
+ dangerMice = java.util.Collections.emptySet();
+ break;
+ case 1:
+ dangerMice = java.util.Collections.singleton(this.dangerMice.get(0));
+ break;
+ default:
+ dangerMice = new java.util.LinkedHashSet<T>(this.dangerMice.size() < 1073741824 ? 1 + this.dangerMice.size() + (this.dangerMice.size() - 3) / 3 : java.lang.Integer.MAX_VALUE);
+ dangerMice.addAll(this.dangerMice);
+ dangerMice = java.util.Collections.unmodifiableSet(dangerMice);
+ }
+ java.util.SortedSet<Number> octopodes = new java.util.TreeSet<Number>();
+ if (this.octopodes != null) octopodes.addAll(this.octopodes);
+ octopodes = java.util.Collections.unmodifiableSortedSet(octopodes);
+ java.util.Set<java.lang.Object> rawSet;
+ switch (this.rawSet == null ? 0 : this.rawSet.size()) {
+ case 0:
+ rawSet = java.util.Collections.emptySet();
+ break;
+ case 1:
+ rawSet = java.util.Collections.singleton(this.rawSet.get(0));
+ break;
+ default:
+ rawSet = new java.util.LinkedHashSet<java.lang.Object>(this.rawSet.size() < 1073741824 ? 1 + this.rawSet.size() + (this.rawSet.size() - 3) / 3 : java.lang.Integer.MAX_VALUE);
+ rawSet.addAll(this.rawSet);
+ rawSet = java.util.Collections.unmodifiableSet(rawSet);
+ }
+ java.util.Set<String> stringSet;
+ switch (this.stringSet == null ? 0 : this.stringSet.size()) {
+ case 0:
+ stringSet = java.util.Collections.emptySet();
+ break;
+ case 1:
+ stringSet = java.util.Collections.singleton(this.stringSet.get(0));
+ break;
+ default:
+ stringSet = new java.util.LinkedHashSet<String>(this.stringSet.size() < 1073741824 ? 1 + this.stringSet.size() + (this.stringSet.size() - 3) / 3 : java.lang.Integer.MAX_VALUE);
+ stringSet.addAll(this.stringSet);
+ stringSet = java.util.Collections.unmodifiableSet(stringSet);
+ }
+ return new BuilderSingletonSets<T>(dangerMice, octopodes, rawSet, stringSet);
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "BuilderSingletonSets.BuilderSingletonSetsBuilder(dangerMice=" + this.dangerMice + ", octopodes=" + this.octopodes + ", rawSet=" + this.rawSet + ", stringSet=" + this.stringSet + ")";
+ }
+ }
+ @java.lang.SuppressWarnings("all")
+ public static <T> BuilderSingletonSetsBuilder<T> builder() {
+ return new BuilderSingletonSetsBuilder<T>();
+ }
+} \ No newline at end of file