映射JSON字符串响应对POJO类
我想将我的字符串响应转换为POJO类。我已经创建了一个名为“ POJO类”的名为“帐户”的POJO类,但无法映射对其的响应。
我的回答 [ { “ accountnumber”:“ 12345”, “帐户类型”:“银行” },, { “ accountnumber”:“ 12389”, “帐户类型”:“银行” },, { “ accountnumber”:“ 12356”, “帐户类型”:“投资” } ]
api调用:
响应率resp = rethtemplate.exchange(url,httpmethod.get,entity,string.class);
I want to convert my string response to POJO Class. I have already created a POJO Class named account with the below variable but can't map the response to it.
My Response
[
{
"accountNumber": "12345",
"accountType": "Banking"
},
{
"accountNumber": "12389",
"accountType": "Banking"
},
{
"accountNumber": "12356",
"accountType": "Investment"
}
]
Api Call:
ResponseEntity resp = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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