I have an HashMap<String, String> that I need sorted in a specific order.
I understand HashMaps,
because of how they are constructed,
cannot be easily sorted.
However,
I am looking for the best strategy to re-arrange the keys in my HashMap - for example my current HashMap looks like this:
"folioProperties": {
"strategy": "Strategy",
"summary": "Summary",
"initiative": "Initiative",
"deliveryMilestone": "Delivery Milestone",
"onTarget": "On Target",
"size": "Size",
"driver": "Driver",
"issueName": "Issue Name",
"releaseWindow": "Release Window",
"type": "Type",
"targetQuarter": "Target Quarter"
}
I have a table view that shows each of these properties as columns and I need to order the columns/hashmap by Strategy, Initiative, Issue Name, Summary, Delivery Milestone, On Target, Size, Target Quarter, Driver, Type, Release Window.
Any suggestions would be appreciated!
P.S. Before the HashMap is constructed, the keys are in a List<String>.