Package org.apache.flink.util
Class IterableUtils
- java.lang.Object
-
- org.apache.flink.util.IterableUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V,G extends Iterable<K>>
Iterable<V>flatMap(Iterable<G> itemGroups, Function<K,V> mapper)
static <E> Stream<E>
toStream(Iterable<E> iterable)
-
-
-
Method Detail
-
toStream
public static <E> Stream<E> toStream(Iterable<E> iterable)
- Type Parameters:
E
- type of the elements of the iterable- Parameters:
iterable
- to convert to a stream- Returns:
- stream converted from the given
Iterable
-
flatMap
@Internal public static <K,V,G extends Iterable<K>> Iterable<V> flatMap(Iterable<G> itemGroups, Function<K,V> mapper)
Flatmap the two-dimensionalIterable
into an one-dimensionalIterable
and convert the keys into items.- Type Parameters:
K
- type of key in the two-dimensional iterableV
- type of items that are mapped toG
- iterable ofIterableUtils
- Parameters:
itemGroups
- to flatmapmapper
- convert theIterableUtils
intoIterableUtils
- Returns:
- flattened one-dimensional
Iterable
from the given two-dimensionalIterable
-
-