Read json with gson

0

I would like to read the JSON below with GSON, put each row in a POJO and add in a ArrayList . But I can not read JSON.

{"user_id":"K4cXASVRZHM6l_t0l_kBzQ","name":"Rob","review_count":238,"friends":"7VQ46TLFWcJ9NC-Sf9r0cQ, GEbyCpz3QmMh23kYcFS_sg, QDFF2MmjuQpeBGTf4yCQZg, Wz0ZiO-tD-QlGBNlX4JZng, 5bfzMNW7lrLXeWB5YG375g"}

{"user_id":"8AUGRc11vpsRtWAltI4jBA","name":"Emily","review_count":29, "friends":"kIkVDAxrvuLmHw86QWG-YQ, eXYhS1UyJc_Y70kJj6yl_A, BeoIUVPMCSYom7KANYQ0ng, R_lyLZuewPOJYH3k8oAhPw, ujY7b27NQ6pFcUuLYYK9BA, JNh4hmFuC40QhQvFToLeQw, 2wWMgBlRmUvli3MBRTlISA"}

{"user_id":"07MFiMnhPoTpQCNYcqGyBQ","name":"Eddie","review_count":24, "friends":"wTvvYzGrmeQYkZ1QDTRi0w, OIMBD_tc_Bu2Ro1UdaDYsw, zZyF0GPjjb5qp63ebUyHcw, 3b1zZxhzQc7lIdFk6fJDxQ, o0eSwQKB04e3SxwqIfhexA, n5MRQzcvCVK2uR43LWxkoQ, xJprckZNAp9v0Vzd-7km7g"}

I tried this way:

public static void main(String[] args) throws FileNotFoundException {
    Gson gson = new Gson();

    JsonReader reader = new JsonReader(new FileReader("yelp_academic_dataset_user.json"));

    List<NoUsuario> data = gson.fromJson(reader, NoUsuario);
}
    
asked by anonymous 10.09.2018 / 21:29

0 answers