I need to get the corresponding "value" based on the "attr_id" from "full_nutrients" array in the JSON response below using Java, how can this be accomplished? For example I want to get the value when "attr_id" == 205.
JSON Response:
"foods": [
{
"food_name": "chicken noodle soup",
"brand_name": null,
"serving_qty": 1,
"serving_unit": "cup",
"serving_weight_grams": 248,
"nf_calories": 62,
"nf_total_fat": 2.36,
"nf_saturated_fat": 0.65,
"nf_cholesterol": 12.4,
"nf_sodium": 865.52,
"nf_total_carbohydrate": 7.32,
"nf_dietary_fiber": 0.5,
"nf_sugars": 0.67,
"nf_protein": 3.15,
"nf_potassium": 54.56,
"nf_p": 42.16,
"full_nutrients": [
{
"attr_id": 203,
"value": 3.1496
},
{
"attr_id": 204,
"value": 2.356
},
{
"attr_id": 205,
"value": 7.316
},
{
"attr_id": 207,
"value": 2.5048
}],
}