简体   繁体   中英

Not able to cast response to particular list object in Java

I'm getting response from a webservice as

[{Id=100, value=1815401000238}, {Id=101, value=1815401000244}]

Here I'm casting the value to list object as

List<Map<String, String>> leadIds

Here I'm passing the response to the method

ServiceUtil.Status(leadIds); 

leadIds has the above response

Here is the method definition

 public Response updateStatus(List<Map<String, String>> leadIds) {

So that I can cast and iterate. But ,it throws me error

java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.util.Map$Entry

What exactly should be casted? I guess its a list object.

进行转换时,尝试使用List<LinkedHashMap<String, String>>而不是List<Map<String, String>>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM