写法1
List<Long> stockCheckSheetIdList = stockCheckSheetPOList
.stream()
.map(StockCheckSheetPO::getId)
.collect(Collectors.toList());写法2
// 数组
Long[] stockCheckProductDetailsIds = stockCheckProductDetailsPOList
.stream()
.map(StockCheckProductDetailsPO::getId)
.toArray(Long[]::new);
// 数组转list
ArrayList<Long> arrayList = new ArrayList<Long>(stockCheckProductDetailsIds.length);
Collections.addAll(arrayList, stockCheckProductDetailsIds);
版权声明:本文为weixin_43991241原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。