【发布时间】:2016-07-13 14:29:49
【问题描述】:
当我做休息课时,我收到了以下回复。
回复:
{
"_index": "a_index",
"total":9,
"_type": "e",
"_id": "BSKnamtd_8-egMNvh",
"_data": 2.076404564,
"_secure": {
"email": "abcd1@gmail.com"
}
}
设置此响应。我已经创建了 pojo 类,如图所示。
public class data implements Serializable {
private static final long serialVersionUID = 644188100766481108L;
private String _index;
private Integer total;
private String _type;
private String _id;
private Double _data;
private Source _secure;
public String getIndex() {
return _index;
}
public void setIndex(String _index) {
this._index = _index;
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
public String getType() {
return _type;
}
public void setType(String _type) {
this._type = _type;
}
public String getId() {
return _id;
}
public void setId(String _id) {
this._id = _id;
}
public Double getData() {
return _data;
}
public void setData(Double _data) {
this._data = _data;
}
public Source getSecure() {
return _secure;
}
public void setSecure(Source _secure) {
this._secure = _secure;
}
}
当我点击 restClient 调用时,我只得到“总”值,剩余值变为空。 “总”变量没有下划线(“”)剩余变量有“”,所以我面临问题..?
请帮助解决这个问题。
【问题讨论】:
-
到目前为止有什么运气吗?
标签: java json spring rest resttemplate