I inherited a project that uses JSON to perform a series of operations as denoted by each object literal. I have zero experience with JSON and while the notation is straight forward, I'm finding working with the object literals less so.
Consider the following file:
[{
"Name": "Hingle McCringleberry",
"ID": "4"
},
{
"Name": "Scoish Velociraptor Maloish",
"ID": "1"
},
{
"Name": "DGlester Hardunkichud",
"ID": "3"
}]
Using Java, I want to sort them by ID. I saw this thread that talks about implementing a JavaScript sort method, but I'm unsure how to do this in practice. I'm using a JsonFactory and JsonParser to read and iterate over the file, but I need them to be sorted before I can process them.