posted 10 years ago
Hi I have a hashmap and a list:
hashmap1 : [5="five",1="one", 4="four"]
list: "one","four","five"
The list tells the order in which the map should be. So the values in the hashmap match to the collection values. I would like to write a code which will change the order of the hashmap based on the collection. So result should be - hashmap1 : [1="one", 4="four",5="five"]
Can you please help on how to achieve this?