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 inListK- key type inMapV- value type inMap- Parameters:
map-Map<K, V>to collect elements frommapper-BiFunctionthat maps from (key, value) pair to type- Returns:
- new
Listthat contains elements after applying mapperBiFunctionto 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 inListK- keys type inMapV- value type inMap- Parameters:
map-Map<K, V>to collect elements frommapper-BiFunctionthat maps from (key, value) pair to typepredicate-Predicatefilter to apply- Returns:
- new
Listthat contains elements that satisfyPredicateafter applying mapperBiFunctionto 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 inListE- elements type inCollection- Parameters:
collection-Collection<E>of elements of typemapper-Function<E, T>mapper function to apply- Returns:
- new
Listthat contains elements that satisfyPredicateafter applying mapperFunctionto 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 inListE- elements type inCollection- Parameters:
collection-Collection<E>of elements of typemapper-Function<E, T>mapper function to applypredicate-Predicatefilter to apply- Returns:
- new
Listthat contains elements after applying mapperFunctionto the inputCollection
-