public class JsonUtil { private static Gson gson; public static <T> T parse(String json,Class<T> tClass){ if (gson == null){ gson = new Gson(); } if(TextUtils.isEmpty(json)){ return null; } return gson.fromJson(json,tClass); } }