aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/before/SuperBuilderBasicToBuilder.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform/resource/before/SuperBuilderBasicToBuilder.java')
-rw-r--r--test/transform/resource/before/SuperBuilderBasicToBuilder.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/transform/resource/before/SuperBuilderBasicToBuilder.java b/test/transform/resource/before/SuperBuilderBasicToBuilder.java
new file mode 100644
index 00000000..93161443
--- /dev/null
+++ b/test/transform/resource/before/SuperBuilderBasicToBuilder.java
@@ -0,0 +1,32 @@
+import java.util.List;
+
+public class SuperBuilderBasicToBuilder {
+ @lombok.experimental.SuperBuilder(toBuilder=true)
+ public static class Parent {
+ private int field1;
+ @lombok.Builder.ObtainVia(field="field1")
+ int obtainViaField;
+ @lombok.Builder.ObtainVia(method="method")
+ int obtainViaMethod;
+ @lombok.Builder.ObtainVia(method = "staticMethod", isStatic = true)
+ String obtainViaStaticMethod;
+ @lombok.Singular List<String> items;
+
+ private int method() {
+ return 2;
+ }
+
+ private static String staticMethod(Parent instance) {
+ return "staticMethod";
+ }
+ }
+
+ @lombok.experimental.SuperBuilder(toBuilder=true)
+ public static class Child extends Parent {
+ private double field3;
+ }
+
+ public static void test() {
+ Child x = Child.builder().field3(0.0).field1(5).item("").build().toBuilder().build();
+ }
+}