Lombok @Builder with Inheritance
@Getter
@SuperBuilder
public class Parent {
// same as before...
@Getter
@SuperBuilder
public class Child extends Parent {
// same as before...
@Getter
@SuperBuilder
public class Student extends Child {
// same as before...When all classes are annotated in this way, we get a builder for the child class that exposes the properties of the parents too.
Note that we have to annotate all classes. @SuperBuilder cannot be mixed with @Builder within the same class hierarchy. Doing so will result in a compilation error.