group

@NotNull
@Unmodifiable
open fun <K, E> group(@NotNull stream: @NotNull Stream<E>, @NotNull keyMapper: @NotNull (E) -> K): @NotNull @Unmodifiable Map<K, List<E>>

Groups stream by some key

Return

grouped map

Parameters

stream

stream

keyMapper

key mapper

<K>

key

<E>

element


@NotNull
@Unmodifiable
open fun <K, E, M : Map<K, List<E>>?> group(@NotNull stream: @NotNull Stream<E>, @NotNull keyMapper: @NotNull (E) -> K, @NotNull mapSupplier: @NotNull Supplier<M>): @NotNull @Unmodifiable M

Groups stream by some key

Return

grouped map

Parameters

stream

stream

keyMapper

key mapper

mapSupplier

map supplier

<K>

key

<E>

element

<M>

map