0
I have the following JSON file:
{"idAluno":1,"nomeAluno":"Teste","listaDeTurmas":[1,2,3,4]}
{"idAluno":4,"nomeAluno":"Teste","listaDeTurmas":[1,2,3,4]}
{"idAluno":3,"nomeAluno":"Teste","listaDeTurmas":[1,2,3,4]}
{"idAluno":5,"nomeAluno":"Teste","listaDeTurmas":[1,2,3,4]}
{"idAluno":2,"nomeAluno":"Teste","listaDeTurmas":[1,3,4]}
I am using the Gson library in Java. It is possible to sort these records increasing in the file based on the "idAluno field"?
Yes, but I would have to deserialize the Json string for an object and use, for example, an Arraylist to sort it, right? There is no way to sort the json file directly, without deserializing the string?
– André Raubach
Then you can’t... you need to deserialize to do anything with the data.
– Leonardo Alves Machado
Okay. Thank you!
– André Raubach