// 加在类或者属性上
@JsonInclude(value = JsonInclude.Include.CUSTOM,
valueFilter = CustomFilter.class)
自定义条件CustomFilter
public class CustomFilter {
@Override
public boolean equals(Object obj) {
// null,或者不是字符串就返回true,意味着不被序列化
if(null==obj || !(obj instanceof String)) {
return true;
}
}
}