I am looking for a JSON library for Java, which allows multiple objects of the same class to be stored in a JSON file, which can then be deserialized by their ID. For example like this:
GroceriesPerDay.json:
{
"monday" {
"apples": "5"
"bananas": "5"
},
"tuesday" {
"apples": "2"
"bananas": "6"
}
}
After deserialization these values should be stored in an object of the class "Groceries" with the attributes "apples" and "bananas" (if their ID would have to be stored as well, that's fine). I can not find a fitting one for the life of me. Any suggestions?