Class Collectors
java.lang.Object
org.apache.drill.common.collections.Collectors
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
K, V> List<T> collect
(List<T> list, Map<K, V> map, BiFunction<K, V, T> mapper) static <T,
K, V> List<T> collect
(List<T> list, Map<K, V> map, BiFunction<K, V, T> mapper, Predicate<T> predicate) static <T,
E> List<T> toList
(Collection<E> collection, Function<E, T> mapper) static <T,
E> List<T> toList
(Collection<E> collection, Function<E, T> mapper, Predicate<T> predicate) static <T,
K, V> List<T> toList
(Map<K, V> map, BiFunction<K, V, T> mapper) static <T,
K, V> List<T> toList
(Map<K, V> map, BiFunction<K, V, T> mapper, Predicate<T> predicate)
-
Method Details
-
toList
- Type Parameters:
T
- elements type inList
K
- key type inMap
V
- value type inMap
- Parameters:
map
-Map<K, V>
to collect elements frommapper
-BiFunction
that maps from (key, value) pair to type- Returns:
- new
List
that contains elements after applying mapperBiFunction
to the inputMap
-
toList
public static <T,K, List<T> toListV> (Map<K, V> map, BiFunction<K, V, T> mapper, Predicate<T> predicate) - Type Parameters:
T
- elements type inList
K
- keys type inMap
V
- value type inMap
- Parameters:
map
-Map<K, V>
to collect elements frommapper
-BiFunction
that maps from (key, value) pair to typepredicate
-Predicate
filter to apply- Returns:
- new
List
that contains elements that satisfyPredicate
after applying mapperBiFunction
to the inputMap
-
collect
-
collect
public static <T,K, List<T> collectV> (List<T> list, Map<K, V> map, BiFunction<K, V, T> mapper, Predicate<T> predicate) -
toList
- Type Parameters:
T
- elements type inList
E
- elements type inCollection
- Parameters:
collection
-Collection<E>
of elements of typemapper
-Function<E, T>
mapper function to apply- Returns:
- new
List
that contains elements that satisfyPredicate
after applying mapperFunction
to the inputCollection
-
toList
public static <T,E> List<T> toList(Collection<E> collection, Function<E, T> mapper, Predicate<T> predicate) - Type Parameters:
T
- elements type inList
E
- elements type inCollection
- Parameters:
collection
-Collection<E>
of elements of typemapper
-Function<E, T>
mapper function to applypredicate
-Predicate
filter to apply- Returns:
- new
List
that contains elements after applying mapperFunction
to the inputCollection
-