From a05360a8eaba0de61f16f75816daf5a5af0a4567 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 15 Jan 2015 04:43:36 +0100 Subject: ecj @Builder @Singular support for j.u. sets and maps. --- .../resource/after-ecj/BuilderSingletonMaps.java | 177 +++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 test/transform/resource/after-ecj/BuilderSingletonMaps.java (limited to 'test/transform/resource/after-ecj/BuilderSingletonMaps.java') diff --git a/test/transform/resource/after-ecj/BuilderSingletonMaps.java b/test/transform/resource/after-ecj/BuilderSingletonMaps.java new file mode 100644 index 00000000..ccd57193 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderSingletonMaps.java @@ -0,0 +1,177 @@ +import java.util.Map; +import java.util.SortedMap; +import lombok.Singular; +@lombok.Builder class BuilderSingletonMaps { + public static @java.lang.SuppressWarnings("all") class BuilderSingletonMapsBuilder { + private java.util.ArrayList women$key; + private java.util.ArrayList women$value; + private java.util.ArrayList men$key; + private java.util.ArrayList men$value; + private java.util.ArrayList rawMap$key; + private java.util.ArrayList rawMap$value; + private java.util.ArrayList stringMap$key; + private java.util.ArrayList stringMap$value; + @java.lang.SuppressWarnings("all") BuilderSingletonMapsBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderSingletonMapsBuilder woman(K womanKey, V womanValue) { + if ((this.women$key == null)) + { + this.women$key = new java.util.ArrayList(); + this.women$value = new java.util.ArrayList(); + } + this.women$key.add(womanKey); + this.women$value.add(womanValue); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingletonMapsBuilder women(java.util.Map women) { + if ((this.women$key == null)) + { + this.women$key = new java.util.ArrayList(); + this.women$value = new java.util.ArrayList(); + } + for (java.util.Map.Entry $lombokEntry : women.entrySet()) + { + this.women$key.add($lombokEntry.getKey()); + this.women$value.add($lombokEntry.getValue()); + } + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingletonMapsBuilder man(K manKey, Number manValue) { + if ((this.men$key == null)) + { + this.men$key = new java.util.ArrayList(); + this.men$value = new java.util.ArrayList(); + } + this.men$key.add(manKey); + this.men$value.add(manValue); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingletonMapsBuilder men(java.util.Map men) { + if ((this.men$key == null)) + { + this.men$key = new java.util.ArrayList(); + this.men$value = new java.util.ArrayList(); + } + for (java.util.Map.Entry $lombokEntry : men.entrySet()) + { + this.men$key.add($lombokEntry.getKey()); + this.men$value.add($lombokEntry.getValue()); + } + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingletonMapsBuilder rawMap(java.lang.Object rawMapKey, java.lang.Object rawMapValue) { + if ((this.rawMap$key == null)) + { + this.rawMap$key = new java.util.ArrayList(); + this.rawMap$value = new java.util.ArrayList(); + } + this.rawMap$key.add(rawMapKey); + this.rawMap$value.add(rawMapValue); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingletonMapsBuilder rawMap(java.util.Map rawMap) { + if ((this.rawMap$key == null)) + { + this.rawMap$key = new java.util.ArrayList(); + this.rawMap$value = new java.util.ArrayList(); + } + for (java.util.Map.Entry $lombokEntry : rawMap.entrySet()) + { + this.rawMap$key.add($lombokEntry.getKey()); + this.rawMap$value.add($lombokEntry.getValue()); + } + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingletonMapsBuilder stringMap(String stringMapKey, V stringMapValue) { + if ((this.stringMap$key == null)) + { + this.stringMap$key = new java.util.ArrayList(); + this.stringMap$value = new java.util.ArrayList(); + } + this.stringMap$key.add(stringMapKey); + this.stringMap$value.add(stringMapValue); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingletonMapsBuilder stringMap(java.util.Map stringMap) { + if ((this.stringMap$key == null)) + { + this.stringMap$key = new java.util.ArrayList(); + this.stringMap$value = new java.util.ArrayList(); + } + for (java.util.Map.Entry $lombokEntry : stringMap.entrySet()) + { + this.stringMap$key.add($lombokEntry.getKey()); + this.stringMap$value.add($lombokEntry.getValue()); + } + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingletonMaps build() { + java.util.Map women; + switch (((this.women$key == null) ? 0 : this.women$key.size())) { + case 0 : + women = java.util.Collections.emptyMap(); + break; + case 1 : + women = java.util.Collections.singletonMap(this.women$key.get(0), this.women$value.get(0)); + break; + default : + women = new java.util.LinkedHashMap(((this.women$key.size() < 0x40000000) ? ((1 + this.women$key.size()) + ((this.women$key.size() - 3) / 3)) : java.lang.Integer.MAX_VALUE)); + for (int $i = 0;; ($i < this.women$key.size()); $i ++) + women.put(this.women$key.get($i), this.women$value.get($i)); + women = java.util.Collections.unmodifiableMap(women); + } + java.util.SortedMap men = new java.util.TreeMap(); + if ((this.men$key != null)) + for (int $i = 0;; ($i < ((this.men$key == null) ? 0 : this.men$key.size())); $i ++) + men.put(this.men$key.get($i), this.men$value.get($i)); + men = java.util.Collections.unmodifiableSortedMap(men); + java.util.Map rawMap; + switch (((this.rawMap$key == null) ? 0 : this.rawMap$key.size())) { + case 0 : + rawMap = java.util.Collections.emptyMap(); + break; + case 1 : + rawMap = java.util.Collections.singletonMap(this.rawMap$key.get(0), this.rawMap$value.get(0)); + break; + default : + rawMap = new java.util.LinkedHashMap(((this.rawMap$key.size() < 0x40000000) ? ((1 + this.rawMap$key.size()) + ((this.rawMap$key.size() - 3) / 3)) : java.lang.Integer.MAX_VALUE)); + for (int $i = 0;; ($i < this.rawMap$key.size()); $i ++) + rawMap.put(this.rawMap$key.get($i), this.rawMap$value.get($i)); + rawMap = java.util.Collections.unmodifiableMap(rawMap); + } + java.util.Map stringMap; + switch (((this.stringMap$key == null) ? 0 : this.stringMap$key.size())) { + case 0 : + stringMap = java.util.Collections.emptyMap(); + break; + case 1 : + stringMap = java.util.Collections.singletonMap(this.stringMap$key.get(0), this.stringMap$value.get(0)); + break; + default : + stringMap = new java.util.LinkedHashMap(((this.stringMap$key.size() < 0x40000000) ? ((1 + this.stringMap$key.size()) + ((this.stringMap$key.size() - 3) / 3)) : java.lang.Integer.MAX_VALUE)); + for (int $i = 0;; ($i < this.stringMap$key.size()); $i ++) + stringMap.put(this.stringMap$key.get($i), this.stringMap$value.get($i)); + stringMap = java.util.Collections.unmodifiableMap(stringMap); + } + return new BuilderSingletonMaps(women, men, rawMap, stringMap); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((((((((((((("BuilderSingletonMaps.BuilderSingletonMapsBuilder(women$key=" + this.women$key) + ", women$value=") + this.women$value) + ", men$key=") + this.men$key) + ", men$value=") + this.men$value) + ", rawMap$key=") + this.rawMap$key) + ", rawMap$value=") + this.rawMap$value) + ", stringMap$key=") + this.stringMap$key) + ", stringMap$value=") + this.stringMap$value) + ")"); + } + } + private @Singular Map women; + private @Singular SortedMap men; + private @SuppressWarnings("all") @Singular("rawMap") Map rawMap; + private @Singular("stringMap") Map stringMap; + @java.lang.SuppressWarnings("all") BuilderSingletonMaps(final Map women, final SortedMap men, final Map rawMap, final Map stringMap) { + super(); + this.women = women; + this.men = men; + this.rawMap = rawMap; + this.stringMap = stringMap; + } + public static @java.lang.SuppressWarnings("all") BuilderSingletonMapsBuilder builder() { + return new BuilderSingletonMapsBuilder(); + } +} \ No newline at end of file -- cgit