I have the following JSON file and wish to parse it to create tweet objects.
the tweet objects should contain user id, username, text, coordinates, and timestamp through the definition of POJO class.
{"text": "I think this would be good. Would hopefully light the fire in the later rounds if you knew you were losing", "user": {"id": "39455201", "name": "Elvis Sinosic"}, "lang": "en","created_at": "Mon Mar 06 22:48:07 +0000 2017"} {"text": "@Night_0f_Fire He's stuck in the alimony machine,, bust him out", "user": {"id": "2744192965", "name": "Mitch L"}, "lang": "en","created_at": "Mon Mar 06 22:47:53 +0000 2017"} this is what i did
import com.fasterxml.jackson.databind.*; import java.util.Arrays; import java.util.List; import java.util.Map; public class Tweets { private long userID; private String userName; private String text; private List<int> coordinates; private String timestamp; } ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper(); Tweets tweets = mapper.readValue(new("/Users/YusufNing/IdeaProjects/comp6700-2017/ass1/parsing/Tweets.java"), Tweets.class);