I am having the below object
List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
How do i sort this based on the value ("Object")
in the Map?
Create your own Comparator
and use it .
List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
Collections.sort(listMap,new Comparator<Map<String, Object>>() {
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
//your logic goes here
}
});
Use your own Comparator (You have to implement the given interface)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With