1
lombok을 사용하여 "PostConstruct"초기화 메소드를 정의 할 수있는 방법이 있습니까?롬복의 "PostConstruct"기능이 있습니까?
@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"
}
}
그래서 같은 객체 init을 할 수있는 : 아직
MyObj obj = MyObj.of(1, 2);
obj.start();