diff options
author | Jan Rieke <it@janrieke.de> | 2020-02-07 14:28:46 +0100 |
---|---|---|
committer | Jan Rieke <it@janrieke.de> | 2020-02-08 16:09:56 +0100 |
commit | 6e2d23fdd7613de9650ffaf00c6e24a6ead0d74b (patch) | |
tree | a68700c831edbf056fa1f8773e7ef9c941eab982 /test/transform/resource/before/SuperBuilderWithSetterPrefix.java | |
parent | cf4e59662a8aac42beee50d2fc28487b7aaf9ea6 (diff) | |
download | lombok-6e2d23fdd7613de9650ffaf00c6e24a6ead0d74b.tar.gz lombok-6e2d23fdd7613de9650ffaf00c6e24a6ead0d74b.tar.bz2 lombok-6e2d23fdd7613de9650ffaf00c6e24a6ead0d74b.zip |
setter prefixes for SuperBuilder
setter prefixes for SuperBuilder [javac]
better javadoc for the SuperBuilder setterPrefix value
setter prefixes for SuperBuilder [ecj]
add test for SuperBuilder setter method customization
fix setter method customization with setterPrefix
Diffstat (limited to 'test/transform/resource/before/SuperBuilderWithSetterPrefix.java')
-rw-r--r-- | test/transform/resource/before/SuperBuilderWithSetterPrefix.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/transform/resource/before/SuperBuilderWithSetterPrefix.java b/test/transform/resource/before/SuperBuilderWithSetterPrefix.java new file mode 100644 index 00000000..5eaef360 --- /dev/null +++ b/test/transform/resource/before/SuperBuilderWithSetterPrefix.java @@ -0,0 +1,32 @@ +import java.util.List; + +public class SuperBuilderWithSetterPrefix { + @lombok.experimental.SuperBuilder(toBuilder=true, setterPrefix = "with") + 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, setterPrefix = "set") + public static class Child extends Parent { + private double field3; + } + + public static void test() { + Child x = Child.builder().setField3(0.0).withField1(5).withItem("").build().toBuilder().build(); + } +} |