1 @JsonProperty("jsonName") 2 private String name;
1 @SerializedName("jsonName") 2 private String name;
使用fastjson
1 {"header":{"code":0,"message":"SUCCESS"},"data":{"id":48,"metric.name":"test_hk_1","metric.type":"kafka_commit","partition.lag":false,"group.id":""}}
1 import com.alibaba.fastjson.JSONObject; 2 JSONObject jsonObject = JSONObject.parseObject(contentAsString).getJSONObject("data");
原文:https://www.cnblogs.com/lcmichelle/p/10742800.html