Spring @Singular사용하여 @Builder로 리스트 초기화

하스레·2022년 7월 4일
0

@Builder 어노테이션 사용 시, 리스트에 @Singular 어노테이션을 붙여야 lombok이 이를 collection으로 인식한다.
따라서 @Singular를 붙이지 않을 시, 그냥 객체로 인식하여 null이 되고, 붙이면 []와 같이 empty list가 되는 것이다.



참고
https://stackoverflow.com/questions/32824821/lombok-builder-not-initializing-collections

profile
Software Developer

0개의 댓글