728x90 @Singular1 [JAVA] @Builder 동작 원리, @Builder.Default, @Singular 1. @Builder 란 @Builder 란 Lombok에서 제공하는 어노테이션으로, 생성자 인자를 메서드 체인을 통해 명시적으로 대입하여 생성자를 호출할 수 있게 빌더 클래스를 생성 해준다. 빌더 클래스와 IDE의 자동 완성 기능을 같이 활용하면 생성자 작성 시 오기입 확률과 인자를 누락할 확률을 낮출 수 있다. API Javadoc의 설명: If a class is annotated, then a private constructor is generated with all fields as arguments (as if @AllArgsConstructor(access = AccessLevel.PRIVATE) is present on the class), and it is as if this constr.. 2022. 9. 16. 이전 1 다음 728x90