mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 08:15:48 +00:00
[SuperBuilder] allow constructor customization
This commit is contained in:
1 parent
faa70bd21d
commit
48b1f17f7e
5 files changed
+81
-15
No files matched your search
@@ -32,12 +32,14 @@ public class SuperBuilderCustomized {
|
||||
}
|
||||
}
|
||||
int field1;
|
||||
protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderCustomized.Parent.ParentBuilder<?, ?> b) {
|
||||
protected Parent(ParentBuilder<?, ?> b) {
|
||||
super();
|
||||
if ((b.field1 == 0))
|
||||
throw new IllegalArgumentException("field1 must be != 0");
|
||||
this.field1 = b.field1;
|
||||
}
|
||||
public static @java.lang.SuppressWarnings("all") SuperBuilderCustomized.Parent.ParentBuilder<?, ?> builder() {
|
||||
return new SuperBuilderCustomized.Parent.ParentBuilderImpl();
|
||||
public static SuperBuilderCustomized.Parent.ParentBuilder<?, ?> builder(int field1) {
|
||||
return new SuperBuilderCustomized.Parent.ParentBuilderImpl().field1(field1);
|
||||
}
|
||||
}
|
||||
public static @lombok.experimental.SuperBuilder class Child extends Parent {
|
||||
|
||||
Reference in new issue
Block a user