In C# I would Deserialize JSON like this, I want to know is there anything available in java that does it the same way? really like this way its clean simple and easy to work it. anyone have a equivalent to it?
string json = @"{
'Name': 'Bad Boys',
'ReleaseDate': '1995-4-7T00:00:00',
'Genres': [
'Action',
'Comedy'
]
}";
Movie m = JsonConvert.DeserializeObject<Movie>(json);
string name = m.Name;
I often use gson from google, it's very simple and does the job:
https://code.google.com/p/google-gson/
To deserialize object:
Movie movie = new Gson().fromJson(json, Movie.class);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With