반응형
외부업체와 연동을 하다보면 아래 와 같이 Boolean 값인데 문자로 "1" , "0" 을 넘겨주는곳이 있다
이럴경우 @JsonSetter을 이용해서 우리가 원하는 값으로 Setter 해서 사용할수가 있다
public class MyDto {
private Boolean isTest;
@JsonSetter("isTest")
public void setTheName(String isTest) {
this.isTest = isTest.equals("1");
}
}
반응형
'BackEnd > spring' 카테고리의 다른 글
Reactive Kafka in Spring Kafka (0) | 2022.03.16 |
---|---|
[springbatch]-[Error] pxc_strict_mode = ENFORCING (0) | 2021.11.30 |
layer dockerfile (0) | 2021.06.28 |
Springboot dockerfile 없이 이미지 생성하기 bootBuildImage (0) | 2021.06.28 |
Webclient retry Test 방법 (0) | 2021.06.14 |