java8之lamda
标签:table list() amd java smo res mit before limited
1、Java8之list获取实体的某一字段
示例
List titles = titleList.stream().map(e -> e.get(ConstantUtil.TITLE)).collect(Collectors.toList());
优化:
List fieldList = mountTableVoList.stream().map(ResMountTable::getFieldName).collect(Collectors.toList());
2、过滤转list
List todayList=todayListOrigin.stream().filter(r->!"a".equals(r.getRiseStatus())).collect(Collectors.toList());
3、转map
Map beforeMap = beforelist.stream().collect(Collectors.toMap(RiseLimitedSumDataDTO::getCode, RiseLimitedSumDataDTO::getName));
java8之lamda
标签:table list() amd java smo res mit before limited
原文地址:https://www.cnblogs.com/javabg/p/12721647.html
评论