Is there a way that I can define a "PostConstruct" initialization method with lombok?
@RequiredArgsConstructor(staticName = "of")
class MyObj {
private final int x;
private final int y;
private int z;
// not work
@PostConstruct
private void someInitLogic {
z = x + y;
}
public void start() {
// code use "z"
}
}
So that I can init an object like:
MyObj obj = MyObj.of(1, 2);
obj.start();