Package tech.ydb.yoj.util.lang
Class BetterCollectors
java.lang.Object
tech.ydb.yoj.util.lang.BetterCollectors
Better versions of collectors from
java.util.stream.Collectors.-
Method Summary
Modifier and TypeMethodDescriptiontoMapNullFriendly(Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper)
-
Method Details
-
toMapNullFriendly
public static <T,K, Collector<T,U> ?, toMapNullFriendlyMap<K, U>> (Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper) - Type Parameters:
T- the type of input elementsK- the type of keysU- the type of values- Parameters:
keyMapper- a mapping function to produce keysvalueMapper- a mapping function to produce values- Returns:
- a map produced from the source stream, possibly with null values
- See Also:
-