0
I have this object filled:
Map<String, List<LogLine>> logMap = new TreeMap<>();
And after I’ve made a filter, I’d like a flat list of it, but I can only create a list
List<List<LogLine>> foo = logMap.entrySet().stream()
.filter(map -> map.getValue().size() > parameters.getThreshold())
.map(map -> map.getValue())
.collect(Collectors.toList());
How can I create only one List with all Logline using stream? I tried to use flatMap, but the compiler won’t let me.
So I know problem is turning from
Map<K, List<V>>
forList<V>
?– Jefferson Quesado