FlatMap () to convert a LinkedList <String> stream to a String stream
My goal is exactly what the title says. What am I doing:
.stream().flatMap(x -> x.getTitles()) getTitles() returns a LinkedList<String> , and I expected flatMap() to do the job and create a stream of strings instead of a LinkedList<String> , but Eclipse says:
Type mismatch: cannot convert from
LinkedList<String>toStream<? extends Object>Stream<? extends Object>
How can i do this? (I need to do this with threads, it's all part of a larger thread)
+5