mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-19 08:15:20 +00:00
[builderParentClass] test cases
This commit is contained in:
1 parent
2a6c0c16b3
commit
6b0b1a6a7b
1 file changed
+20
@@ -0,0 +1,20 @@
|
||||
import lombok.Builder;
|
||||
import lombok.Singular;
|
||||
import java.util.List;
|
||||
|
||||
public class BuilderWithInherit {
|
||||
@Builder(extensible = true)
|
||||
public static class Parent {
|
||||
int field1;
|
||||
@Singular List<String> items;
|
||||
}
|
||||
|
||||
@Builder(inherit = true)
|
||||
public static class Child extends Parent {
|
||||
double field3;
|
||||
}
|
||||
|
||||
public static void test() {
|
||||
Child x = Child.builder().field3(0.0).field1(5).item("").build();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user