Json 序列化的三種方式:spa
1.Gsoncode
@SerializedName("idcard") private String idcardNo;
2.fastJsonblog
@JSONField(name="idcard") private String idcardNo;
3.JackSonast
@JsonProperty("idcard") private String idcardNo;
類上進行判斷返回值數據不爲空的屬性 JsonInclude.Include.NON_NULLclass
@JsonInclude(JsonInclude.Include.NON_NULL) public class Test { private String name; private int age; }