list转map<User.getCode,User>
Map<String,User> map =
list.stream().collect(Collectors.toMap(User::getCode, Function.identity(), (key1, key2) -> key2));
list1转list2<User.getCode>,当userType==1
List list2 =
list1.stream().filter(e -> e.getType() == 1).map(TagTreeRel::getCode).collect(Collectors.toList());
list1转list2<User.getNmae>
List list2 =
list1.stream().map(a -> a.getName()).collect(Collectors.toList());
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- ovod.cn 版权所有 湘ICP备2023023988号-4
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务