Answer the question
In order to leave comments, you need to log in
How can you easily deserialize json into ready-made model classes in Java (just like newtonsoft for c#)?
How can I easily deserialize json into ready-made model classes in Java? I myself mostly write in c#, now I needed to write a small project on android, I ran into the problem of easy parsing of json data. On the Internet, they suggest making a constructor for each class, and in it, for each field, set the values \u200b\u200bderived from JSONObject'a, which is quite dreary. Maybe somehow I was looking in the wrong way, but for example in c# (using newtonsoft ) I can do just
string jsonString = "{...json строка...}";
DataResult result = JsonConvert.DeserializeObject<DataResult>(jsonString);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question