how to convert class to json json object with Gson code example
Example: json to object gson
User user= gson.fromJson(jsonInString, User.class);
// where jsonInString is your json {"userId":"1","userName":"Yasir"}
User user= gson.fromJson(jsonInString, User.class);
// where jsonInString is your json {"userId":"1","userName":"Yasir"}