문제

How can I tell a class to include only NON_EMPTY and NON_NULL values only, Using

@JsonInclude(Include.NON_NULL)
@JsonInclude(Include.NON_EMPTY)
public class foo{
    String a;
}

is throwing error of duplicate annotation.

도움이 되었습니까?

해결책

"Null is always considered empty" - Jackson's site

So the NON_EMPTY rule covers both cases..

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top