Stream 常见操作

flatMap

将多个数组"烫平",
前:[[a,b],[c,d]]
后:[a,b,c,d]
flatMaplamber表达式返回的参数是数组

list.stream().map(item -> Configuration.from(item.getWidgets()))                
.flatMap(item-> ((JSONArray)item.getInternal()).stream())
posted @ 2022-01-19 10:35  Rorchachl  阅读(34)  评论(0)    收藏  举报