[JAVA] @getter boolean 타입 호출 안될 때
lombok 사용하여 getter, setter 메소드를 만들 경우 boolean 타입의 필드만 'No candidates found for method call' 해당 문구가 뜨는 현상을 볼 수 있다. 자동으로 생성되는 boolean 타입의 getter는 is로 만들어준다. https://projectlombok.org/features/GetterSetter @Getter and @Setter projectlombok.org private boolean notice; User.getNotice(); --> X User.isNotice(); --> O 통일성을 위해 getNotice를 사용하고 싶다면 해당 필드를 선언할 때, Boolean 형식으로 선언하면 get 네이밍을 사용할 수 있다. * boole..
Development/JAVA
2023. 1. 27. 18:15
링크
최근에 올라온 글
- Total
- Today
- Yesterday