Code example for Gson

Methods: fromJson

0
        return jsonString;
    } 
 
    @SuppressWarnings("unchecked") 
    protected Map<String, Object> getDataFromResponse(String jsonString) {
        Gson gson = new Gson();
 
        Type mapType = new TypeToken<Map<String, ?>>() {
        }.getType();
        Map<String, ?> responseMap = gson.fromJson(jsonString, mapType);
 
        return (Map<String, Object>) responseMap.get("data");
    } 
 
} 
Experience pair programming with AI  Get Codota for Java