Skip to content
Advertisement

Tag: linq

Java Stream equivalent of LINQ SelectMany()

What’s the Java 8 Stream equivalent of LINQ’s SelectMany? For example, in C#, if I have Dictionary<string, List<Tag>> tags that I want to turn into an IEnumerable<Tag> (a flat enumerable of all the tags in the dictionary), I would do tags.SelectMany(kvp => kvp.Value). Is there a Java equivalent for a Map<String, List<Tag>> that would yield a Stream<Tag>? Answer You’re looking

Advertisement