public <T> T getObj(Class<T> clz) { if (TextUtils.isEmpty(data)) return null; return JSONUtil.fromJson(data, clz); // return gson.fromJson(data, clz); }
public <T> List<T> getList(Class<T> clz) { if (TextUtils.isEmpty(data)) return null; List<T> list = new ArrayList<T>(); Type listType = type(List.class, clz); // list = gson.fromJson(data, listType); list = JSONUtil.fromJson(data, listType); return list; }