⑴ gson实体转json时当字段值为空时,json串中就不存在该属于,请问如何在值为空的时候也保留该字符串
用这种方式就可以了:
Gson g = new GsonBuilder().serializeNulls().create();