Common Operations
Collect
List<String> list;
list = strings.stream().collect(Collectors.toList());String string;
string = strings.stream().collect(Collectors.joining(", "));Map<String, Named> map;
map = objs.stream().collect(Collectors.toMap(Named::getName, Function.identity()));Filter
Collection<Object> collection;
Collection<Object> filtered;
// Collection is initialized
// Removes null values
filtered = collection.stream().filter(Objects::nonNull).collect(Collectors.toList());Map
Flat Map
Reduce
Consume (Apply to All)
Concatenate
Last updated