I have a parent abstract class "Parent" and child class "Child". I am using @SuperBuilder to generate builder APIs. Now, I want to perform some validations on the members of class "Parent" and "Child" as part of build. I couldn't find any solution to customize lombok super builder. As per lombok doc, it seems to be possible. Can someone please shed some light?
@SuperBuilder
public abstract class Parent {
int x;
int y;
int z;
int a;
}
@SuperBuilder
public abstract class Child extends Parent {
int b;
int c;
int d;
// I want something like
public static class ChildBuilder {
public Child build() {
Child child = // Get child somehow;
validate(child);
}
}
}