0

This object is from an API call. I want this object in LinkedHashMap<key, Pair<String, String>> form, as I have to use both keys and values. If this is not possible what is the best possible way to do this. Do I need to convert this array into object also?

Object:

"recurring_frequencies": {
                    "none": [
                        "None",
                        "0"
                    ],
                    "daily": [
                        "Daily",
                        "1"
                    ],
                    "weekly": [
                        "Weekly",
                        "7"
                    ],
                    "bi-weekly": [
                        "Bi-weekly",
                        "14"
                    ],
                    "monthly": [
                        "Monthly",
                        "28"
                    ],
                    "quarterly": [
                        "Quarterly",
                        "91"
                    ],
                    "semi-annually": [
                        "Semi-annually",
                        "182"
                    ],
                    "annually": [
                        "Annually",
                        "365"
                    ]
                }
            }
Marzi Heidari
  • 2,660
  • 4
  • 25
  • 57

1 Answers1

0

Have a look at this question. I assume that the API returns a JSON string, which can be parsed by JSONObject. Afterwards you can extract all information by iterating through all entries.

Lecagy
  • 489
  • 2
  • 10