我要用list去接收dataSourceResponse这个参数改怎么办啊,是List<>new一个新的list嘛
1.在遍历的上面定义一个List
2.在每一次遍历的最后将dataSourceResponse存入到List中
List<DataSourceResponse> dataSourceResponseList = new ArrayList()<>;
for(String key:set){
......(原来的代码)
dataSourceResponseList.add(dataSourceResponse);
}
如果它是一个对象或者实体类,直接新建一个对象List