diff options
author | Jan Rieke <it@janrieke.de> | 2020-05-01 23:56:17 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2020-05-28 21:18:35 +0200 |
commit | 48b1f17f7ef0e0b3d90dee74ee1b490a02cacff2 (patch) | |
tree | 1e7d52d4a53b3e9e9b8ba73edc99421a03102d24 /test/transform/resource/after-delombok | |
parent | faa70bd21d2872e8354574cc98c7aa82ab996bcd (diff) | |
download | lombok-48b1f17f7ef0e0b3d90dee74ee1b490a02cacff2.tar.gz lombok-48b1f17f7ef0e0b3d90dee74ee1b490a02cacff2.tar.bz2 lombok-48b1f17f7ef0e0b3d90dee74ee1b490a02cacff2.zip |
[SuperBuilder] allow constructor customization
Diffstat (limited to 'test/transform/resource/after-delombok')
-rw-r--r-- | test/transform/resource/after-delombok/SuperBuilderCustomized.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/test/transform/resource/after-delombok/SuperBuilderCustomized.java b/test/transform/resource/after-delombok/SuperBuilderCustomized.java index bffa72fa..f66133c9 100644 --- a/test/transform/resource/after-delombok/SuperBuilderCustomized.java +++ b/test/transform/resource/after-delombok/SuperBuilderCustomized.java @@ -23,6 +23,13 @@ public class SuperBuilderCustomized { }
}
int field1;
+ protected Parent(ParentBuilder<?, ?> b) {
+ if (b.field1 == 0) throw new IllegalArgumentException("field1 must be != 0");
+ this.field1 = b.field1;
+ }
+ public static SuperBuilderCustomized.Parent.ParentBuilder<?, ?> builder(int field1) {
+ return new SuperBuilderCustomized.Parent.ParentBuilderImpl().field1(field1);
+ }
@java.lang.SuppressWarnings("all")
private static final class ParentBuilderImpl extends SuperBuilderCustomized.Parent.ParentBuilder<SuperBuilderCustomized.Parent, SuperBuilderCustomized.Parent.ParentBuilderImpl> {
@java.lang.SuppressWarnings("all")
@@ -39,14 +46,6 @@ public class SuperBuilderCustomized { return new SuperBuilderCustomized.Parent(this);
}
}
- @java.lang.SuppressWarnings("all")
- protected Parent(final SuperBuilderCustomized.Parent.ParentBuilder<?, ?> b) {
- this.field1 = b.field1;
- }
- @java.lang.SuppressWarnings("all")
- public static SuperBuilderCustomized.Parent.ParentBuilder<?, ?> builder() {
- return new SuperBuilderCustomized.Parent.ParentBuilderImpl();
- }
}
public static class Child extends Parent {
private static final class ChildBuilderImpl extends ChildBuilder<Child, ChildBuilderImpl> {
|