Java8新特性lamda表达式

List<RoleDO> allRoles = roleService.list();

//获取角色中备注不是app的集合
List<RoleDO> webRoles = allRoles.stream()
.filter(item -> !("app".equals(item.getRemark())))
.collect(Collectors.toList());

猜你喜欢

转载自www.cnblogs.com/liw66/p/9988856.html