Skip to content
Advertisement

Tag: nested-map

Convert a List of JSON-objects input into a nested Map

I have a String input in the following format: Input String: [{ “id”:”1″, “name”:”A”, “address”:”St 1″},{ “id”:”2″, “name”:”B”, “address”:”St 2″}, …] And I want to be able to convert this to a Map<String, Map<String, String>> format. So, something like: Required Output Format: {1: {id:1, name:”A”, address: “St 1″} 2: {id:2, name:”B”, address: “St 2”}} I created a class to help

Advertisement