Archives mensuelles : décembre 2018

Java 8 collecting inside a FlatMap : some limitations

Stream.map() and Stream.flatMap() methods are very close methods as discussed here. Here we will discuss about Stream.flatMap() limitations . We can broadly identify two usages of Stream.flatMap(): – flattening a nested stream within the initial stream to perform the main collect operation on … Continuer la lecture

Publié dans java, java 8, java 9, Non classé | Laisser un commentaire

Java 8 flatMap or how to « flat mapped » a stream to another stream

Stream.map() and Stream.flatMap() methods are very close methods. These map a stream to another one by applying the function passed as argument for each element of the initial stream. But these are not applied in the same context. map() expects any … Continuer la lecture

Publié dans flatmap, java, java8, lambda | Laisser un commentaire