My Object like this:
@DaTa
@builder
@NoArgsConstructor
@AllArgsConstructor
public class TestResult {
private List<Map.Entry<String, Double>> dps;
}
and my jsontext is :
[
{
"dps": {
"1557936000": 1893.0,
"1558022400": 0.0
}
},
{
"dps": {
"1557936000": 954.0,
"1558022400": 0.0
}
}
]
when i use JSON.parseArray(jsontext , TestResult .class) then stackoverflow!
when i change
private List<Map.Entry<String, Double>> dps; to private List<Map.Entry> dps;
the result is ok
but i found that the type of value is bigdecimal
1条答案
按热度按时间c0vxltue1#
According to your definition of
TestResult
, your inputjsontext
does not matchTestResult
array. Your jsontext should be like this: