public class FunctionalUtils extends Object
| Constructor and Description |
|---|
FunctionalUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <K,V> Map<K,Pair<List<V>,List<V>>> |
cogroup(List<Pair<K,V>> left,
List<Pair<K,V>> right)
For each key in left and right, cogroup returns the list of values
as a pair for each value present in left as well as right.
|
static <K,V> Map<K,List<V>> |
groupByKey(List<Pair<K,V>> listInput)
Group the input pairs by the key of each pair.
|
static <K,V> List<Pair<K,V>> |
mapToPair(Map<K,V> map)
Convert a map with a set of entries of type K for key
and V for value in to a list of
Pair |
public static <K,V> Map<K,Pair<List<V>,List<V>>> cogroup(List<Pair<K,V>> left, List<Pair<K,V>> right)
K - the key typeV - the value typeleft - the left list of pairs to joinright - the right list of pairs to joinpublic static <K,V> Map<K,List<V>> groupByKey(List<Pair<K,V>> listInput)
K - the key typeV - the value typelistInput - the list of pairs to groupCopyright © 2022. All rights reserved.