RecordMould recordMould = buildRecordMould();
//獲得逗號字符串
String sheetIds = CastUtil.toNotNullString(aims_recordmould_info.get("sheetList"));
List<Integer> ids = null;
//是否是逗號字符串
if(Pattern.matches("-?\\d+(,-?\\d+)*", sheetIds)) {//也要匹配負數
//轉爲數字數組
Integer[] arr = (Integer[]) ConvertUtils.convert(sheetIds, Integer[].class);
Arrays.sort(arr);
ids = new ArrayList<Integer>(Arrays.asList(arr));
}else {
ids = new ArrayList<Integer>();
}
將List<String> 轉爲逗號字符串
org.apache.commons.lang3.StringUtils.join(applyNameList, ",");