I have two classes Child extends Parent. I need to put @Builder annotation on the classes such that I do not need to create the builder my self.
See in https://blog.codecentric.de/en/2016/05/reducing-boilerplate-code-project-lombok/ (@Builder and inheritance part)
Adjusted to your classes
@AllArgsConstructor
public class Parent {
private double d;
private float e;
}
public class Child extends Parent {
private String a;
private int b;
private boolean c;
@Builder
public Child(String a, int b, boolean c, double d, float e) {
super(d, e);
this.a = a;
this.b = b;
this.c = c;
}
}
With this setup
Child child = Child.builder().a("aVal").b(1000).c(true).d(10.1).e(20.0F).build();
works correctly