Lombok @Builder doesn't work for inheritance use cases:
For example
class Foo{
protected int xyz1;
.....
protected String xyz7;
}
class Bar extends Foo{
}
For given use case Lombok will not be able to generate methods to set value of parameter defined in Foo class.
A workaround for this is:
- Manual creating constructor of Bar.
- Putting a Builder annotation on that constructor.
Is there a better workaround ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…