1. 将json串转为list
String blackUids = "[1,2,3,4]";
List<Long> ids = JSONObject.parseArray(blackUids, Long.class);
  1. 将逗号分隔字符串转为list
List<Long> uids = Arrays.asList(blackListUids.split(",")).stream().map(uid -> NumberUtils.toLong(uid)).collect(Collectors.toList());
  1. 将字符串转为数组
String[] skuIds = skuLevelBonusMergeDTO.getSkuIds().split(",")
  1. 待续

hizengzeng
177 声望10 粉丝

hizengzeng