{
"response": [
{
"messages": [
{
"parameters": {
"PRECEDENCE": "3",
"ENTITY_CLASS": "ACCOUNT"
}
},
{
"parameters": {
"PRECEDENCE": "16",
"ENTITY_CLASS": "PRODUCT"
}
},
{
"parameters": {
"PRECEDENCE": "1",
"ENTITY_CLASS": "ACCOUNT"
}
}
]
}
]
}
I want the output should be ordered based value in ascending order
{
"response": [
{
"messages": [
{
"parameters": {
"PRECEDENCE": "1",
"ENTITY_CLASS": "ACCOUNT"
}
},
{
"parameters": {
"PRECEDENCE": "3",
"ENTITY_CLASS": "PRODUCT"
}
},
{
"parameters": {
"PRECEDENCE": "16",
"ENTITY_CLASS": "ACCOUNT"
}
}
]
}
]
}
Current structure I have
Response
Set<essage> message
Map<String, String> parameters = new HashMap<>();
I was trying by manual compare. is there a way I can iterate and sort the map values.
How can I optimize efficiently?