Converted a Json String to a Java object using objectMapper . Now from Json array I can not get the value for Cod or dtBeg . deserialize.getAlgorithms prints an array.
here is json
{ "status": 1, "message": "ok", "sheduleCod": "NOST_A_Persons_m_noaccum", "algorithms": [{ "cod": "No_st_alg_1", "kcp": "U6000427", "dtBeg": "2017-11-01 00:00:00", "dtEnd": "2017-12-01 00:00:00" }, { "cod": "No_st_alg_2", "kcp": "U6000427", "dtBeg": "2017-11-01 00:00:00", "dtEnd": "2017-12-01 00:00:00" }, { "cod": "No_st_alg_3", "kcp": "U6000427", "dtBeg": "2017-11-01 00:00:00", "dtEnd": "2017-12-01 00:00:00" }] }
Main.Class
JsonDeserialize deserialize = objectMapper.readValue(jsonString, JsonDeserialize.class); System.out.println(deserialize.getAlgorithms)
System.out.println(deserialize.getAlgorithms[0].getCod)- Igor