具体的Stream用法可以参考:List.stream() 各方法应用_Bulldozer Coder的博客-CSDN博客文章来源:https://www.toymoban.com/news/detail-546623.html
List<MyBingeWatchBean> checkList = adapter.getCheckList(); String docids = ""; if(checkList!=null&&checkList.size()>0){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { docids = checkList.stream().map(it->it.getDoc_id()).collect(Collectors.joining(",")); }else { for (int i = 0; i < checkList.size(); i++) { MyBingeWatchBean documentBean = checkList.get(i); docids = documentBean.getDoc_id()+","+docids; } } documentViewModel.deleteFollowDecumentary(docids); }
用流操作的确简介很多文章来源地址https://www.toymoban.com/news/detail-546623.html
到了这里,关于List用Stream流操作ID例子的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!