As in Java, you can easily deserialize json to model classes ready (just like newtonsoft in c#)?

As in Java, you can easily deserialize json to classes ready model? I mostly write in c#, now need to write a small project on android, was faced with the problem of easy parsing of json data. The Internets offer to do a constructor for each class and for each field to set the values derived from JSONObject'a, which is quite a chore. Can somehow not so searched for, but for example in c# (using newtonsoft ) I can do just
string jsonString = "{...json string...}";
DataResult result = JsonConvert.DeserializeObject<dataresult>(jsonString);</dataresult>

I hope for your help!
July 2nd 19 at 18:17
1 answer
July 2nd 19 at 18:19
Solution
Maybe you are looking for GSON
GsonInstance Gson = new Gson();
String json = "{...json string...}";

DataResult result = gsonInstance.fromJson(json, DataResult.class);


UPD I expect that people who prefer other libraries, too, write about them, but alas. This approach is supported at least in Jackson.

Find more questions by tags JavaAndroid