public class Collectors extends Object
| Modifier and Type | Method and Description |
|---|---|
static <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) |
public static <T,K,V> List<T> toList(Map<K,V> map, BiFunction<K,V,T> mapper)
T - elements type in ListK - key type in MapV - value type in Mapmap - Map<K, V> to collect elements frommapper - BiFunction that maps from (key, value) pair to type List that contains elements after applying mapper BiFunction to the input Mappublic static <T,K,V> List<T> toList(Map<K,V> map, BiFunction<K,V,T> mapper, Predicate<T> predicate)
T - elements type in ListK - keys type in MapV - value type in Mapmap - Map<K, V> to collect elements frommapper - BiFunction that maps from (key, value) pair to type predicate - Predicate filter to applyList that contains elements that satisfy Predicate after applying mapper BiFunction
to the input Mappublic static <T,K,V> List<T> collect(List<T> list, Map<K,V> map, BiFunction<K,V,T> mapper)
public static <T,K,V> List<T> collect(List<T> list, Map<K,V> map, BiFunction<K,V,T> mapper, Predicate<T> predicate)
public static <T,E> List<T> toList(Collection<E> collection, Function<E,T> mapper)
T - elements type in ListE - elements type in Collectioncollection - Collection<E> of elements of type mapper - Function<E, T> mapper function to applyList that contains elements that satisfy Predicate after applying mapper Function
to the input Collectionpublic static <T,E> List<T> toList(Collection<E> collection, Function<E,T> mapper, Predicate<T> predicate)
T - elements type in ListE - elements type in Collectioncollection - Collection<E> of elements of type mapper - Function<E, T> mapper function to applypredicate - Predicate filter to applyList that contains elements after applying mapper Function to the input CollectionCopyright © 2021 The Apache Software Foundation. All rights reserved.