diff options
author | Caleb Brinkman <cbrinkman@sonatype.com> | 2019-09-12 11:27:08 -0500 |
---|---|---|
committer | Caleb Brinkman <cbrinkman@sonatype.com> | 2019-09-12 11:28:20 -0500 |
commit | 36287f2ff9ed2f809f8c1c76155919417ad04d3c (patch) | |
tree | 45f5e4da4216d95bf36935c699495a8850ae61b1 /test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java | |
parent | cc070254a68331c2593c37359921854c74692661 (diff) | |
download | lombok-36287f2ff9ed2f809f8c1c76155919417ad04d3c.tar.gz lombok-36287f2ff9ed2f809f8c1c76155919417ad04d3c.tar.bz2 lombok-36287f2ff9ed2f809f8c1c76155919417ad04d3c.zip |
Duplicate builder tests with setter prefix
Diffstat (limited to 'test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java')
-rw-r--r-- | test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java new file mode 100644 index 00000000..086e0701 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java @@ -0,0 +1,60 @@ +import lombok.Singular; +@lombok.Builder(toBuilder = true, setterPrefix = "with") class BuilderSingularToBuilderWithNull { + public static @java.lang.SuppressWarnings("all") class BuilderSingularToBuilderWithNullBuilder { + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> elems; + @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder withElem(final String elem) { + if ((this.elems == null)) + this.elems = new java.util.ArrayList<String>(); + this.elems.add(elem); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder withElems(final java.util.Collection<? extends String> elems) { + if ((this.elems == null)) + this.elems = new java.util.ArrayList<String>(); + this.elems.addAll(elems); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder clearElems() { + if ((this.elems != null)) + this.elems.clear(); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNull build() { + java.util.List<String> elems; + switch (((this.elems == null) ? 0 : this.elems.size())) { + case 0 : + elems = java.util.Collections.emptyList(); + break; + case 1 : + elems = java.util.Collections.singletonList(this.elems.get(0)); + break; + default : + elems = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.elems)); + } + return new BuilderSingularToBuilderWithNull(elems); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("BuilderSingularToBuilderWithNull.BuilderSingularToBuilderWithNullBuilder(elems=" + this.elems) + ")"); + } + } + private @Singular java.util.List<String> elems; + public static void test() { + new BuilderSingularToBuilderWithNull(null).toBuilder(); + } + @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNull(final java.util.List<String> elems) { + super(); + this.elems = elems; + } + public static @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder builder() { + return new BuilderSingularToBuilderWithNullBuilder(); + } + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder toBuilder() { + final BuilderSingularToBuilderWithNullBuilder builder = new BuilderSingularToBuilderWithNullBuilder(); + if ((this.elems != null)) + builder.elems(this.elems); + return builder; + } +} |