diff options
Diffstat (limited to 'test/transform/resource/after-delombok')
7 files changed, 213 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java b/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java index 3c84c71b..ae865570 100644 --- a/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java +++ b/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java @@ -1,3 +1,5 @@ +import lombok.Builder; +@Builder public class BuilderDefaultsWarnings { long x = System.currentTimeMillis(); final int y = 5; @@ -78,6 +80,7 @@ public class BuilderDefaultsWarnings { } class NoBuilderButHasDefaults { private final long z = 5; + @Builder public NoBuilderButHasDefaults() { } @java.lang.SuppressWarnings("all") diff --git a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java index ba6ddc52..4c9de174 100644 --- a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java +++ b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java @@ -1,4 +1,5 @@ import java.util.List; +@lombok.Builder class BuilderSingularNoAuto { private List<String> things; private List<String> widgets; diff --git a/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java index 857348d3..48b396eb 100644 --- a/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java +++ b/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java @@ -1,4 +1,5 @@ import java.util.List; +@lombok.Builder(setterPrefix = "with") class BuilderSingularNoAutoWithSetterPrefix { private List<String> things; private List<String> widgets; diff --git a/test/transform/resource/after-delombok/JacksonizedBuilderComplex.java b/test/transform/resource/after-delombok/JacksonizedBuilderComplex.java new file mode 100644 index 00000000..30f6b9af --- /dev/null +++ b/test/transform/resource/after-delombok/JacksonizedBuilderComplex.java @@ -0,0 +1,55 @@ +//CONF: lombok.builder.className = Test*Name +import java.util.List; +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = JacksonizedBuilderComplex.TestVoidName.class) +class JacksonizedBuilderComplex { + private static <T extends Number> void testVoidWithGenerics(T number, int arg2, String arg3, JacksonizedBuilderComplex selfRef) { + } + @java.lang.SuppressWarnings("all") + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "with", buildMethodName = "execute") + public static class TestVoidName<T extends Number> { + @java.lang.SuppressWarnings("all") + private T number; + @java.lang.SuppressWarnings("all") + private int arg2; + @java.lang.SuppressWarnings("all") + private String arg3; + @java.lang.SuppressWarnings("all") + private JacksonizedBuilderComplex selfRef; + @java.lang.SuppressWarnings("all") + TestVoidName() { + } + @java.lang.SuppressWarnings("all") + public JacksonizedBuilderComplex.TestVoidName<T> withNumber(final T number) { + this.number = number; + return this; + } + @java.lang.SuppressWarnings("all") + public JacksonizedBuilderComplex.TestVoidName<T> withArg2(final int arg2) { + this.arg2 = arg2; + return this; + } + @java.lang.SuppressWarnings("all") + public JacksonizedBuilderComplex.TestVoidName<T> withArg3(final String arg3) { + this.arg3 = arg3; + return this; + } + @java.lang.SuppressWarnings("all") + public JacksonizedBuilderComplex.TestVoidName<T> withSelfRef(final JacksonizedBuilderComplex selfRef) { + this.selfRef = selfRef; + return this; + } + @java.lang.SuppressWarnings("all") + public void execute() { + JacksonizedBuilderComplex.<T>testVoidWithGenerics(this.number, this.arg2, this.arg3, this.selfRef); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "JacksonizedBuilderComplex.TestVoidName(number=" + this.number + ", arg2=" + this.arg2 + ", arg3=" + this.arg3 + ", selfRef=" + this.selfRef + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static <T extends Number> JacksonizedBuilderComplex.TestVoidName<T> builder() { + return new JacksonizedBuilderComplex.TestVoidName<T>(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/JacksonizedBuilderSimple.java b/test/transform/resource/after-delombok/JacksonizedBuilderSimple.java new file mode 100644 index 00000000..bd79df90 --- /dev/null +++ b/test/transform/resource/after-delombok/JacksonizedBuilderSimple.java @@ -0,0 +1,50 @@ +import java.util.List; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +@JsonIgnoreProperties(ignoreUnknown = true) +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = JacksonizedBuilderSimple.JacksonizedBuilderSimpleBuilder.class) +class JacksonizedBuilderSimple<T> { + private final int noshow = 0; + private final int yes; + private List<T> also; + private int $butNotMe; + @java.lang.SuppressWarnings("all") + JacksonizedBuilderSimple(final int yes, final List<T> also) { + this.yes = yes; + this.also = also; + } + @java.lang.SuppressWarnings("all") + @JsonIgnoreProperties(ignoreUnknown = true) + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "", buildMethodName = "build") + protected static class JacksonizedBuilderSimpleBuilder<T> { + @java.lang.SuppressWarnings("all") + private int yes; + @java.lang.SuppressWarnings("all") + private List<T> also; + @java.lang.SuppressWarnings("all") + JacksonizedBuilderSimpleBuilder() { + } + @java.lang.SuppressWarnings("all") + public JacksonizedBuilderSimple.JacksonizedBuilderSimpleBuilder<T> yes(final int yes) { + this.yes = yes; + return this; + } + @java.lang.SuppressWarnings("all") + public JacksonizedBuilderSimple.JacksonizedBuilderSimpleBuilder<T> also(final List<T> also) { + this.also = also; + return this; + } + @java.lang.SuppressWarnings("all") + public JacksonizedBuilderSimple<T> build() { + return new JacksonizedBuilderSimple<T>(this.yes, this.also); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "JacksonizedBuilderSimple.JacksonizedBuilderSimpleBuilder(yes=" + this.yes + ", also=" + this.also + ")"; + } + } + @java.lang.SuppressWarnings("all") + protected static <T> JacksonizedBuilderSimple.JacksonizedBuilderSimpleBuilder<T> builder() { + return new JacksonizedBuilderSimple.JacksonizedBuilderSimpleBuilder<T>(); + } +} diff --git a/test/transform/resource/after-delombok/JacksonizedSuperBuilderSimple.java b/test/transform/resource/after-delombok/JacksonizedSuperBuilderSimple.java new file mode 100644 index 00000000..7fd3f8dc --- /dev/null +++ b/test/transform/resource/after-delombok/JacksonizedSuperBuilderSimple.java @@ -0,0 +1,55 @@ +public class JacksonizedSuperBuilderSimple {
+ @com.fasterxml.jackson.annotation.JsonIgnoreProperties(ignoreUnknown = true)
+ @com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = JacksonizedSuperBuilderSimple.Parent.ParentBuilderImpl.class)
+ public static class Parent {
+ int field1;
+ @java.lang.SuppressWarnings("all")
+ public static abstract class ParentBuilder<C extends JacksonizedSuperBuilderSimple.Parent, B extends JacksonizedSuperBuilderSimple.Parent.ParentBuilder<C, B>> {
+ @java.lang.SuppressWarnings("all")
+ private int field1;
+ @java.lang.SuppressWarnings("all")
+ protected abstract B self();
+ @java.lang.SuppressWarnings("all")
+ public abstract C build();
+ @java.lang.SuppressWarnings("all")
+ public B field1(final int field1) {
+ this.field1 = field1;
+ return self();
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "JacksonizedSuperBuilderSimple.Parent.ParentBuilder(field1=" + this.field1 + ")";
+ }
+ }
+ @java.lang.SuppressWarnings("all")
+ @com.fasterxml.jackson.annotation.JsonIgnoreProperties(ignoreUnknown = true)
+ @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "", buildMethodName = "build")
+ static final class ParentBuilderImpl extends JacksonizedSuperBuilderSimple.Parent.ParentBuilder<JacksonizedSuperBuilderSimple.Parent, JacksonizedSuperBuilderSimple.Parent.ParentBuilderImpl> {
+ @java.lang.SuppressWarnings("all")
+ private ParentBuilderImpl() {
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ protected JacksonizedSuperBuilderSimple.Parent.ParentBuilderImpl self() {
+ return this;
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public JacksonizedSuperBuilderSimple.Parent build() {
+ return new JacksonizedSuperBuilderSimple.Parent(this);
+ }
+ }
+ @java.lang.SuppressWarnings("all")
+ protected Parent(final JacksonizedSuperBuilderSimple.Parent.ParentBuilder<?, ?> b) {
+ this.field1 = b.field1;
+ }
+ @java.lang.SuppressWarnings("all")
+ public static JacksonizedSuperBuilderSimple.Parent.ParentBuilder<?, ?> builder() {
+ return new JacksonizedSuperBuilderSimple.Parent.ParentBuilderImpl();
+ }
+ }
+ public static void test() {
+ Parent x = Parent.builder().field1(5).build();
+ }
+}
diff --git a/test/transform/resource/after-delombok/JacksonizedSuperBuilderWithJsonDeserialize.java b/test/transform/resource/after-delombok/JacksonizedSuperBuilderWithJsonDeserialize.java new file mode 100644 index 00000000..df52db33 --- /dev/null +++ b/test/transform/resource/after-delombok/JacksonizedSuperBuilderWithJsonDeserialize.java @@ -0,0 +1,48 @@ +@lombok.experimental.SuperBuilder +@com.fasterxml.jackson.databind.annotation.JsonDeserialize +public class JacksonizedSuperBuilderWithJsonDeserialize { + int field1; + @java.lang.SuppressWarnings("all") + public static abstract class JacksonizedSuperBuilderWithJsonDeserializeBuilder<C extends JacksonizedSuperBuilderWithJsonDeserialize, B extends JacksonizedSuperBuilderWithJsonDeserialize.JacksonizedSuperBuilderWithJsonDeserializeBuilder<C, B>> { + @java.lang.SuppressWarnings("all") + private int field1; + @java.lang.SuppressWarnings("all") + protected abstract B self(); + @java.lang.SuppressWarnings("all") + public abstract C build(); + @java.lang.SuppressWarnings("all") + public B field1(final int field1) { + this.field1 = field1; + return self(); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "JacksonizedSuperBuilderWithJsonDeserialize.JacksonizedSuperBuilderWithJsonDeserializeBuilder(field1=" + this.field1 + ")"; + } + } + @java.lang.SuppressWarnings("all") + private static final class JacksonizedSuperBuilderWithJsonDeserializeBuilderImpl extends JacksonizedSuperBuilderWithJsonDeserialize.JacksonizedSuperBuilderWithJsonDeserializeBuilder<JacksonizedSuperBuilderWithJsonDeserialize, JacksonizedSuperBuilderWithJsonDeserialize.JacksonizedSuperBuilderWithJsonDeserializeBuilderImpl> { + @java.lang.SuppressWarnings("all") + private JacksonizedSuperBuilderWithJsonDeserializeBuilderImpl() { + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + protected JacksonizedSuperBuilderWithJsonDeserialize.JacksonizedSuperBuilderWithJsonDeserializeBuilderImpl self() { + return this; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public JacksonizedSuperBuilderWithJsonDeserialize build() { + return new JacksonizedSuperBuilderWithJsonDeserialize(this); + } + } + @java.lang.SuppressWarnings("all") + protected JacksonizedSuperBuilderWithJsonDeserialize(final JacksonizedSuperBuilderWithJsonDeserialize.JacksonizedSuperBuilderWithJsonDeserializeBuilder<?, ?> b) { + this.field1 = b.field1; + } + @java.lang.SuppressWarnings("all") + public static JacksonizedSuperBuilderWithJsonDeserialize.JacksonizedSuperBuilderWithJsonDeserializeBuilder<?, ?> builder() { + return new JacksonizedSuperBuilderWithJsonDeserialize.JacksonizedSuperBuilderWithJsonDeserializeBuilderImpl(); + } +}
\ No newline at end of file |