JSONArray转javaList对象,下划线字母转小驼峰方法 方法一:利用Gson的setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) List<EduCurrencyRateHistory> saveRateList = new ArrayList<>(); // 使用Gson进行转换 Gson gson = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .create(); list.forEach(item -> { EduCurrencyRateHistory eduCurrencyRateHistory = gson.fromJson(item.toString(), EduCurrencyRateHistory.class); saveRateList.add(eduCurrencyRateHistory); }); 方法二:JSONReader.Feature.SupportSmartMatch List<EduCurrencyRateHistory> saveList = list.toJavaList(EduCurrencyRateHistory.class, JSONReader.Feature.SupportSmartMatch);