0

I have a JSON file with the following contents. Note that the dates are totally dynamic so I am unable to access them using names.

{
  "calendar": {
    "dateToDayId": {
      "2016-08-24": 370271,
      "2016-08-22": 370206,
      "2016-08-25": 370223,
      "2016-08-21": 370200,
      "2016-08-23": 370208
    },
    "dishIdToMealId": {
      "1567539": 603971,
      "1567542": 603971,
      "1567570": 603980,
      "1567781": 604075,
      "1567789": 604005
    },
    "mealIdToDayId": {
      "603971": 370200,
      "603980": 370206,
      "603982": 370208,
      "603984": 370208,
      "604005": 370223,
      "604075": 370271
    }
  },
  "earliestDate": "2016-08-22"
}

How to I traverse all the elements of dateToDayId and store the values in a list and then go to dishIdToMealId and do the same thing. Also, is it possible to map these to a Java object?

0 Answers0