jdk8 中 int 类型可以直接转换成Integer类型 不需要强制转换

String name = jsonObject.getJSONObject("search").getString("name");
		int pageSize = jsonObject.getJSONObject("page").getInt("pageSize");
		int currentPage = jsonObject.getJSONObject("page").getInt("currentPage");
		
		List<?> list = dictionaryDao.getDictionaryList(name,pageSize,currentPage);
		int recordCount = dictionaryDao.getDictionaryCount(name, pageSize, currentPage);
		
		Map<String, Integer> pageMap = new HashMap<String, Integer>();
		pageMap.put("recordCount", recordCount);
		pageMap.put("pageSize", pageSize);
		pageMap.put("currentPage", currentPage);
		
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("data", list);
		map.put("page", pageMap);
		String jsonStr = JSON.toJSONString(map);


你可能感兴趣的:(jdk8 中 int 类型可以直接转换成Integer类型 不需要强制转换)