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())
将多个数组"烫平",
前:[[a,b],[c,d]]
后:[a,b,c,d]
flatMaplamber表达式返回的参数是数组
list.stream().map(item -> Configuration.from(item.getWidgets()))
.flatMap(item-> ((JSONArray)item.getInternal()).stream())