I have a JSON Document. I have converted the document as a Map<String, String> in which some of the keys have list of Maps (List<Map<String,String>>) as value. I want to sort this List<Map<String,String>.
Just an example: (after storing the JSON document in Map<String,String>
1. key: name, value: {first=John, last=Doe}
2. key: address, value: null
3. key: birthday, value: 1980-01-01
4. key: company, value: Acme
5. key: occupation, value: Software engineer
6. key: phones, value: [{number=9, type=mobile1}, {number=1, type=mobile}, {type=home, number=0}]
7. key: groups, value: [gym, close-friends]
In the above example in line 6 Key = "phones" has value as list of maps that I have to sort.
Expected Output:
1. key: name, value: {first=John, last=Doe}
2. key: address, value: null
3. key: birthday, value: 1980-01-01
4. key: company, value: Acme
5. key: occupation, value: Software engineer
6. key: phones, value: [{number=0, type=home}, {number=1, type=mobile}, {number=9, type=mobile1}]
7. key: groups, value: [gym, close-friends]