Man I thought it'd be easy to use GSON, apparently it isn't as easy to deserialize a JSON String as it is to serialize...
Let me guide you through the process; i'm making a dieting app for a friend of mine and I'm using JSON to store the diets, later I'll use them to create HTML reports and such. In my GUI's controller, I have a DietSchedule object that gets initialized as such:
From what I've read online, the problem is that the types collections hold, do not get "saved" or something along these lines, I don't have much experience with generics and (de)serialization. I believe there is a solution to this (from what I've read) but I'm too much of a noob to understand it or know where to fix it in my code.
In my controller I'm using ObservableLists (JavaFX8), so I thought it would be better to use List in the MealLists since it's a supertype and thus would accept every sub-type.
I'm attaching the basics of my classes, any help would be greatly appreciated (I don't want to save to XML instead of JSON, XML is more difficult to handle than JSON in HTML [according to a friend of mine that is]).
Let me guide you through the process; i'm making a dieting app for a friend of mine and I'm using JSON to store the diets, later I'll use them to create HTML reports and such. In my GUI's controller, I have a DietSchedule object that gets initialized as such:
From what I've read online, the problem is that the types collections hold, do not get "saved" or something along these lines, I don't have much experience with generics and (de)serialization. I believe there is a solution to this (from what I've read) but I'm too much of a noob to understand it or know where to fix it in my code.
In my controller I'm using ObservableLists (JavaFX8), so I thought it would be better to use List in the MealLists since it's a supertype and thus would accept every sub-type.
I'm attaching the basics of my classes, any help would be greatly appreciated (I don't want to save to XML instead of JSON, XML is more difficult to handle than JSON in HTML [according to a friend of mine that is]).