@H_404_2@String、JsonObject、JavaBean 互相转换
User user = new Gson()@H_404_2@.fromJson(jsonObject,User@H_404_2@.class);
User user = new Gson()@H_404_2@.fromJson(@H_404_2@string,User@H_404_2@.class);
@H_404_2@String @H_404_2@string = new Gson()@H_404_2@.toJson(user);
JsonObject jsonObject = new Gson()@H_404_2@.toJsonTree(user)@H_404_2@.getAsJsonObject();
JsonObject jsonObject = new JsonParser()@H_404_2@.parse(@H_404_2@string)@H_404_2@.getAsJsonObject();
@H_404_2@String、JsonArray、@H_404_2@List互相转换
@H_404_2@List<User> userList = gson@H_404_2@.fromJson(@H_404_2@string,new TypeToken<@H_404_2@List<User>>() {}@H_404_2@.getType());
@H_404_2@List<User> userList = gson@H_404_2@.fromJson(jsonArray,new TypeToken<@H_404_2@List<User>>() {}@H_404_2@.getType());
@H_404_2@String @H_404_2@string = new Gson()@H_404_2@.toJson(userList);
JsonArray jsonArray = new Gson()@H_404_2@.toJsonTree(userList,new TypeToken<@H_404_2@List<User>>() {}@H_404_2@.getType())@H_404_2@.getAsJsonArray();
JsonArray jsonArray = new JsonParser()@H_404_2@.parse(@H_404_2@string)@H_404_2@.getAsJsonArray();