I have a data structure of type List<Map<String, String>>
and I am looking to sort out all the Map values inside the List as per the value. For example - the list when iterated gives a Map which consists of two key value pairs.
Map1--> Key1: abc and key2: Sometext2
Map2 --> Key1: cbd and key2: Sometext2
Map3 --> Key1: bcd and key2: Sometext2
.
.
.
.
and so on. I am looking to sort alphabetically the data structure by the values mapped to key1 so it should look like:
Map1--> Key1: abc and key2:Sometext2.
Map3 --> Key1: bcd and key2: Sometext2
Map2 --> Key1: cbd and key2: Sometext2
.
.
.
.
I am using Java 7. Any help is highly appreciated.
Thanks