将JSON转换为Pojo班
我一直在努力转换以下JSON。
- 是否应将数据类映射为映射< string,对象>。然后将对象映射类用于所有值?在POJO
JSON响应
{
"data": {
"Order": [
{
{
"Property1" : Number1
"Propery2": Number 2
},
"Lines": [
{
"Id": "123456",
"itemDescription": "Green glass",
}
],
"date": "",
"updateDate": ""
}
]
}
}
数据类下方映射映射的最佳方法是什么:
@JsonIgnoreProperties(ignoreUnknown = true)
public class Details {
public Map<String,Object> data;
}
I have been struggling with converting the below json .
- Is the data class should be mapped as Map<String,Object>.Then use Object mapper class to all values?What is the best way to map below pojo
Json Response
{
"data": {
"Order": [
{
{
"Property1" : Number1
"Propery2": Number 2
},
"Lines": [
{
"Id": "123456",
"itemDescription": "Green glass",
}
],
"date": "",
"updateDate": ""
}
]
}
}
Data class:
@JsonIgnoreProperties(ignoreUnknown = true)
public class Details {
public Map<String,Object> data;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论