java通过某个键将<Long,List<String>>映射到字符串Lambda的列表
我有一个类似{
我还有一个键列表,比如List<Long> keyList = Arrays.asList(1L, 3L, 10L);
我想通过这些keyList's
提取List<String>
,并使用lambda表达式生成单个List<String>
你可以在下面搜索框中键入要查询的问题!
我有一个类似{
我还有一个键列表,比如List<Long> keyList = Arrays.asList(1L, 3L, 10L);
我想通过这些keyList's
提取List<String>
,并使用lambda表达式生成单个List<String>
# 1 楼答案
试试这个:
# 2 楼答案
另一种方法是使用
reduce
而不是flatMap, collect
: