Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- java.lang.nosuchmethoderror
- bytebuddyinterceptor
- jsonignore
- websecurityconfiguration
- Swagger
- springboot
Archives
- Today
- Total
NOT FOUND
lombok @Builder 특정 필드만 재정의하는 법 본문
빌더에서 특정 필드를 재정의하는 걸 원했다
public static class ABuilder {
public ABuilder owner(String owner) {
this.isOwner = Objects.equals(owner, "소유자");
return this;
}
public ABuilder landShare(String share) {
this.isOwner = Objects.equals(share, "공유");
return this;
}
}
A class라고 쳤을 때 클래스 안에 이런식으로 ABuilder을 적고 아래 원하는 필드만 재정의해주면 된다