【发布时间】:2016-02-06 00:21:09
【问题描述】:
我有这个 json
{"FechaUpdateId":1,"FechaSegundos":635902782941643690,"FechaSegundosBC":635902779020935030}
我执行此命令将其转换为对象
FechaUpdate dto = new Gson().fromJson(json, FechaUpdate.class);
但我得到了这个结果
这是我的 FechaUpdate 课程
public class FechaUpdate {
public int getFechaUpdateId() {
return fechaUpdateId;
}
public void setFechaUpdateId(int fechaUpdateId) {
this.fechaUpdateId = fechaUpdateId;
}
public long getFechaSegundosBC() {
return fechaSegundosBC;
}
public void setFechaSegundosBC(long fechaSegundosBC) {
this.fechaSegundosBC = fechaSegundosBC;
}
public long getFechaSegundos() {
return fechaSegundos;
}
public void setFechaSegundos(long fechaSegundos) {
this.fechaSegundos = fechaSegundos;
}
private int fechaUpdateId ;
private long fechaSegundos ;
private long fechaSegundosBC;
}
【问题讨论】: