public interface MapStream<K,V>
extends java.util.stream.Stream<java.util.Map.Entry<K,V>>
Map.Entry<K, V>.| Modifier and Type | Method and Description |
|---|---|
default java.util.Map<K,V> |
collect()
Return a Map from the stream.
|
default java.util.Map<K,V> |
collect(java.util.function.BinaryOperator<V> mergeFunction)
Return a Map from the stream.
|
MapStream<K,V> |
distinct() |
MapStream<K,V> |
filter(java.util.function.Predicate<? super java.util.Map.Entry<K,V>> predicate) |
default MapStream<V,K> |
inverseMapping()
Return a MapStream from which the key and values are reversed.
|
MapStream<K,V> |
limit(long n) |
default <K1,V1> MapStream<K1,V1> |
mapEntries(java.util.function.Function<? super K,? extends K1> keyMapper,
java.util.function.Function<? super V,? extends V1> valueMapper)
Applies the mapping for each keys and values in the map.
|
default <K1> MapStream<K1,V> |
mapKeys(java.util.function.Function<? super K,? extends K1> mapper)
Applies the mapping for each keys in the map.
|
default <V1> MapStream<K,V1> |
mapValues(java.util.function.Function<? super V,? extends V1> mapper)
Applies the mapping for each values in the map.
|
default MapStream<K,java.util.List<V>> |
mergeKeys()
Merge keys of the Stream into a new Stream
|
default MapStream<K,V> |
mergeKeys(java.util.function.BinaryOperator<V> mergeFunction)
Merge keys of the Stream into a new Stream with the merge function provided
|
static <K,V> MapStream<K,V> |
of(K key,
V value)
Construct a
MapStream<K, V> from a single key-value pair |
static <K,V> MapStream<K,V> |
of(K key,
V value,
K key1,
V value1)
Construct a
MapStream<K, V> from a multiple key-value pairs |
static <K,V> MapStream<K,V> |
of(K key,
V value,
K key1,
V value1,
K key2,
V value2)
Construct a
MapStream<K, V> from a multiple key-value pairs |
static <K,V> MapStream<K,V> |
of(K key,
V value,
K key1,
V value1,
K key2,
V value2,
K key3,
V value3)
Construct a
MapStream<K, V> from a multiple key-value pairs |
static <K,V> MapStream<K,V> |
of(K key,
V value,
K key1,
V value1,
K key2,
V value2,
K key3,
V value3,
K key4,
V value4)
Construct a
MapStream<K, V> from a multiple key-value pairs |
static <K,V> MapStream<K,V> |
of(java.util.Map<K,V> map)
Construct a
MapStream<K, V> from the map |
static <K,V> MapStream<K,V> |
ofMaps(java.util.Map<K,V>... maps)
Construct a
MapStream<K, V> from the map |
MapStream<K,V> |
onClose(java.lang.Runnable closeHandler) |
MapStream<K,V> |
parallel() |
MapStream<K,V> |
peek(java.util.function.Consumer<? super java.util.Map.Entry<K,V>> action) |
MapStream<K,V> |
sequential() |
MapStream<K,V> |
skip(long n) |
MapStream<K,V> |
sorted() |
MapStream<K,V> |
sorted(java.util.Comparator<? super java.util.Map.Entry<K,V>> comparator) |
MapStream<K,V> |
unordered() |
allMatch, anyMatch, builder, collect, collect, concat, count, empty, findAny, findFirst, flatMap, flatMapToDouble, flatMapToInt, flatMapToLong, forEach, forEachOrdered, generate, iterate, map, mapToDouble, mapToInt, mapToLong, max, min, noneMatch, reduce, reduce, reduce, toArray, toArraystatic <K,V> MapStream<K,V> of(java.util.Map<K,V> map)
MapStream<K, V> from the map@SafeVarargs static <K,V> MapStream<K,V> ofMaps(java.util.Map<K,V>... maps)
MapStream<K, V> from the mapK - - the type of the map keysV - - the type of the map valuesmaps - - the map to build the stream fromMapStream<K, V>static <K,V> MapStream<K,V> of(K key, V value)
MapStream<K, V> from a single key-value pairK - - the type of the map keysV - - the type of the map valueskey - - the keyvalue - - the valueMapStream<K, V>static <K,V> MapStream<K,V> of(K key, V value, K key1, V value1)
MapStream<K, V> from a multiple key-value pairsK - - the type of the map keysV - - the type of the map valueskey - - keyvalue - - valuekey1 - - key1value1 - - value1MapStream<K, V>static <K,V> MapStream<K,V> of(K key, V value, K key1, V value1, K key2, V value2)
MapStream<K, V> from a multiple key-value pairsK - - the type of the map keysV - - the type of the map valueskey - - keyvalue - - valuekey1 - - key1value1 - - value1key2 - - key2value2 - - value2MapStream<K, V>static <K,V> MapStream<K,V> of(K key, V value, K key1, V value1, K key2, V value2, K key3, V value3)
MapStream<K, V> from a multiple key-value pairsK - - the type of the map keysV - - the type of the map valueskey - - keyvalue - - valuekey1 - - key1value1 - - value1key2 - - key2value2 - - value2key3 - - key3value3 - - value3MapStream<K, V>static <K,V> MapStream<K,V> of(K key, V value, K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
MapStream<K, V> from a multiple key-value pairsK - - the type of the map keysV - - the type of the map valueskey - - keyvalue - - valuekey1 - - key1value1 - - value1key2 - - key2value2 - - value2key3 - - key3value3 - - value3key4 - - key4value4 - - value4MapStream<K, V>default <K1> MapStream<K1,V> mapKeys(java.util.function.Function<? super K,? extends K1> mapper)
mergeKeys or that you provide a merge function when calling
collectK1 - the type to map the keys intomapper - - the key mapping to be applieddefault <V1> MapStream<K,V1> mapValues(java.util.function.Function<? super V,? extends V1> mapper)
V1 - the type to map the values intomapper - - the value mapping to be applieddefault <K1,V1> MapStream<K1,V1> mapEntries(java.util.function.Function<? super K,? extends K1> keyMapper, java.util.function.Function<? super V,? extends V1> valueMapper)
mergeKeys or that you provide a merge
function when calling collect.K1 - the type to map the keys intoV1 - the type to map the values intokeyMapper - - the key mapping to be appliedvalueMapper - - the value mapping to be applieddefault MapStream<K,java.util.List<V>> mergeKeys()
default MapStream<K,V> mergeKeys(java.util.function.BinaryOperator<V> mergeFunction)
mergeFunction - The merge function to usedefault java.util.Map<K,V> collect()
mergeKeys() or collect (BinaryOperator<V> mergeFunction)default java.util.Map<K,V> collect(java.util.function.BinaryOperator<V> mergeFunction)
mergeFunction - the function to merge the values if the keys are not uniquedefault MapStream<V,K> inverseMapping()
MapStream<K,V> filter(java.util.function.Predicate<? super java.util.Map.Entry<K,V>> predicate)
Copyright © 2015. All Rights Reserved.