JSON取别名/返回不为空的数据
Json 序列化的三种方式:
1.Gson
@SerializedName("idcard")
private String idcardNo;
2.fastJson
@JSONField(name="idcard") private String idcardNo;
3.JackSon
@JsonProperty("idcard")
private String idcardNo;
类上进行判断返回值数据不为空的属性 JsonInclude.Include.NON_NULL
@JsonInclude(JsonInclude.Include.NON_NULL) public class Test { private String name; private int age; }

浙公网安备 33010602011771号