Eric N Eric N - 1 year ago 107
Java Question

Turning JSON list into POJO

Here's the JSON:


And my current POJO:

public class WantMessage {

Map<String, String> wantmap = new HashMap<String, String>();
public String EndPoint;

I get the "Endpoint" String in ok but am missing the data in the "Want" section. How would you pull in the want list?

Answer Source

wantmap has keys and values of type String. The map in json has int values. Try putting the numbers in double quotes, and see if it works.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download