I'm parsing a json using Jackson's JsonNode. My json structure looks like this (let this be variable rawJson):
{
<some fields...>,
"results" : [
{
"name" : "name1",
"data" : ...,
"values" : 13
},
{
"name" : "name2",
"data" : ...,
"values" : 20
},
.
.
.
{
"name" : "name_n",
"data" : ...,
"values" : 151
}
]
}
in Java:
ObjectMapper mapper = new ObjectMapper();
JsonNode results = mapper.readValue(rawJson, JsonNode.class).get("results");
How can I get the particular JsonNode element by filtering the attribute name
? How about if I want to get JsonNode elements whose value
greater than X? Can I accomplish these without looping through the results
variable?