I am trying to generate JSON string from Map in sorted order of json element's value. Here is my JSON
"customer": {
"id": "168252733",
"firstName": "OTP",
"lastName": "KPI",
"contact": {
"emailAddress": "nona.adams1@gmail.com",
"phone": [
{
"number": "2567775065",
"type": "primary"
},
{
"number": "2567775065",
"type": "secondary"
}
]
}
}
This Json can contains multiple customer records but I want the json to be generated should be in sorted order of either firstname, lastname or email depending on the user preference.
I am new to JACKSON, don't know how to implement it. Can anybody help me on this. Thanks in Advance.