private static Gson gson = new Gson();
public static String toJson(Object object)
{
return gson.toJson(object);
}
public static <T> T fromJson(String json, TypeToken<T> token)
{
return gson.fromJson(json, token.getType());
}
时间: 2024-10-10 22:24:56