I am using objectmapper to convert the class into json. Following is the code:
JSONParser parser = new JSONParser();
ObjectMapper mapper = new ObjectMapper();
String obj = mapper.writeValueAsString(myClass);
JSONObject jsonObject = (JSONObject)parser.perse(obj);
now line number 4 where I get the jsobObject reshuffles the order of class member.
See the attached image, before it converting to jsonobject "authorisation" was first element then signatries.
But at line 4 it becomes 2nd ..... why ?
I want order to be preserved, that is the requirement of my project.
Please help !