diff options
Diffstat (limited to 'test/transform/resource')
-rw-r--r-- | test/transform/resource/before/BuilderWithToBuilder.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/transform/resource/before/BuilderWithToBuilder.java b/test/transform/resource/before/BuilderWithToBuilder.java new file mode 100644 index 00000000..98b7cebc --- /dev/null +++ b/test/transform/resource/before/BuilderWithToBuilder.java @@ -0,0 +1,36 @@ +import java.util.List; +import lombok.Builder; + +@Builder(toBuilder = true) @lombok.experimental.Accessors(prefix = "m") +class BuilderWithToBuilder<T> { + private String mOne, mTwo; + @Builder.ObtainVia(method = "rrr", isStatic = true) private T foo; + @lombok.Singular private List<T> bars; + + public static <K> K rrr(BuilderWithToBuilder<K> x) { + return x.foo; + } +} + +@lombok.experimental.Accessors(prefix = "m") +class ConstructorWithToBuilder<T> { + private String mOne, mTwo; + private T foo; + @lombok.Singular private List<T> bars; + + @Builder(toBuilder = true) + public ConstructorWithToBuilder(String mOne, @Builder.ObtainVia(field = "foo") T bar) { + } +} + +@lombok.experimental.Accessors(prefix = "m") +class StaticWithToBuilder<T> { + private String mOne, mTwo; + private T foo; + @lombok.Singular private List<T> bars; + + @Builder(toBuilder = true) + public static <Z> StaticWithToBuilder<Z> test(String mOne, @Builder.ObtainVia(field = "foo") Z bar) { + return new StaticWithToBuilder<Z>(); + } +} |