跟昨天介绍的eclipse-collections一样,这是一个同类产品:
仓库地址:https://github.com/amaembo/streamex
JavaDoc
:http://amaembo.github.io/streamex/javadoc/one/util/streamex/package-summary.html
感受下:
代码语言:javascript复制List<String> userNames = StreamEx.of(users).map(User::getName).toList();
Map<Role, List<User>> role2users = StreamEx.of(users).groupingBy(User::getRole);
StreamEx.of(1,2,3).joining("; "); // "1; 2; 3"
对比起来好像比eclipse-collections
写更少代码
而且更向原生stream
靠拢
文档:https://github.com/amaembo/streamex/blob/master/wiki/CHEATSHEET.md