diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-01-05 05:39:35 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-01-05 05:39:35 +0100 |
commit | 4618097d986f08a922191332c87a7d8c73e34f96 (patch) | |
tree | 3fd1dad63c641d5403835a33efd479b93c952fb9 /test/transform/resource/after-delombok/BuilderSingletons.java | |
parent | f180ab3c17eb78b5c36821203fb4afc26ba6ddbb (diff) | |
download | lombok-4618097d986f08a922191332c87a7d8c73e34f96.tar.gz lombok-4618097d986f08a922191332c87a7d8c73e34f96.tar.bz2 lombok-4618097d986f08a922191332c87a7d8c73e34f96.zip |
@Singleton for j.u.Sets works in javac.
Diffstat (limited to 'test/transform/resource/after-delombok/BuilderSingletons.java')
-rw-r--r-- | test/transform/resource/after-delombok/BuilderSingletons.java | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/BuilderSingletons.java b/test/transform/resource/after-delombok/BuilderSingletons.java new file mode 100644 index 00000000..049af0a4 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderSingletons.java @@ -0,0 +1,90 @@ +import java.util.Set; +import java.util.SortedSet; +class BuilderSingletons<T> { + private Set<T> dangerMice; + private SortedSet<? extends Number> octopodes; + private Set rawSet; + private Set<String> stringSet; + @java.lang.SuppressWarnings("all") + BuilderSingletons(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 BuilderSingletonsBuilder<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") + BuilderSingletonsBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder<T> dangerMouse(final T dangerMouse) { + this.dangerMice.add(dangerMouse); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder<T> dangerMice(final java.util.Collection<? extends T> dangerMice) { + this.dangerMice.addAll(dangerMice); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder<T> octopus(final Number octopus) { + this.octopodes.add(octopus); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder<T> octopodes(final java.util.Collection<? extends Number> octopodes) { + this.octopodes.addAll(octopodes); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder<T> rawSet(final java.lang.Object rawSet) { + this.rawSet.add(rawSet); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder<T> rawSet(final java.util.Collection<?> rawSet) { + this.rawSet.addAll(rawSet); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder<T> stringSet(final String stringSet) { + this.stringSet.add(stringSet); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder<T> stringSet(final java.util.Collection<? extends String> stringSet) { + this.stringSet.addAll(stringSet); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletons<T> build() { + java.util.Set<T> dangerMice = new java.util.LinkedHashSet<T>(this.dangerMice.size() < 1073741824 ? this.dangerMice.size() < 3 ? this.dangerMice.size() + 1 : this.dangerMice.size() + this.dangerMice.size() / 3 : java.lang.Integer.MAX_VALUE, 0.75F); + dangerMice.addAll(this.dangerMice); + dangerMice = java.util.Collections.unmodifiableSet(dangerMice); + java.util.SortedSet<Number> octopodes = new java.util.TreeSet<Number>(); + octopodes.addAll(this.octopodes); + octopodes = java.util.Collections.unmodifiableSortedSet(octopodes); + java.util.Set<java.lang.Object> rawSet = new java.util.LinkedHashSet<java.lang.Object>(this.rawSet.size() < 1073741824 ? this.rawSet.size() < 3 ? this.rawSet.size() + 1 : this.rawSet.size() + this.rawSet.size() / 3 : java.lang.Integer.MAX_VALUE, 0.75F); + rawSet.addAll(this.rawSet); + rawSet = java.util.Collections.unmodifiableSet(rawSet); + java.util.Set<String> stringSet = new java.util.LinkedHashSet<String>(this.stringSet.size() < 1073741824 ? this.stringSet.size() < 3 ? this.stringSet.size() + 1 : this.stringSet.size() + this.stringSet.size() / 3 : java.lang.Integer.MAX_VALUE, 0.75F); + stringSet.addAll(this.stringSet); + stringSet = java.util.Collections.unmodifiableSet(stringSet); + return new BuilderSingletons<T>(dangerMice, octopodes, rawSet, stringSet); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderSingletons.BuilderSingletonsBuilder(dangerMice=" + this.dangerMice + ", octopodes=" + this.octopodes + ", rawSet=" + this.rawSet + ", stringSet=" + this.stringSet + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static <T> BuilderSingletonsBuilder<T> builder() { + return new BuilderSingletonsBuilder<T>(); + } +}
\ No newline at end of file |