Package | Description |
---|---|
io.vavr |
Beside
API the io.vavr package contains core types like (Checked)Functions and Tuples. |
io.vavr.collection |
Purely functional collections based on Traversable.
|
Modifier and Type | Method and Description |
---|---|
static <K,V> Map<K,V> |
API.LinkedMap()
Alias for
LinkedHashMap.empty() |
static <K,V> Map<K,V> |
API.LinkedMap(K k1,
V v1)
Alias for
LinkedHashMap.of(Object, Object) |
static <K,V> Map<K,V> |
API.LinkedMap(K k1,
V v1,
K k2,
V v2)
|
static <K,V> Map<K,V> |
API.LinkedMap(K k1,
V v1,
K k2,
V v2,
K k3,
V v3)
|
static <K,V> Map<K,V> |
API.LinkedMap(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4)
|
static <K,V> Map<K,V> |
API.LinkedMap(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5)
|
static <K,V> Map<K,V> |
API.LinkedMap(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6)
|
static <K,V> Map<K,V> |
API.LinkedMap(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7)
|
static <K,V> Map<K,V> |
API.LinkedMap(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8)
|
static <K,V> Map<K,V> |
API.LinkedMap(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8,
K k9,
V v9)
|
static <K,V> Map<K,V> |
API.LinkedMap(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8,
K k9,
V v9,
K k10,
V v10)
|
static <K,V> Map<K,V> |
API.LinkedMap(Tuple2<? extends K,? extends V>... entries)
Deprecated.
Will be removed in a future version.
|
static <K,V> Map<K,V> |
API.Map()
Alias for
HashMap.empty() |
static <K,V> Map<K,V> |
API.Map(K k1,
V v1)
Alias for
HashMap.of(Object, Object) |
static <K,V> Map<K,V> |
API.Map(K k1,
V v1,
K k2,
V v2)
|
static <K,V> Map<K,V> |
API.Map(K k1,
V v1,
K k2,
V v2,
K k3,
V v3)
|
static <K,V> Map<K,V> |
API.Map(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4)
|
static <K,V> Map<K,V> |
API.Map(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5)
|
static <K,V> Map<K,V> |
API.Map(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6)
|
static <K,V> Map<K,V> |
API.Map(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7)
|
static <K,V> Map<K,V> |
API.Map(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8)
|
static <K,V> Map<K,V> |
API.Map(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8,
K k9,
V v9)
|
static <K,V> Map<K,V> |
API.Map(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8,
K k9,
V v9,
K k10,
V v10)
|
static <K,V> Map<K,V> |
API.Map(Tuple2<? extends K,? extends V>... entries)
Deprecated.
Will be removed in a future version.
|
default <K,V> Map<K,V> |
Value.toLinkedMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper)
Converts this to a
Map . |
default <K,V> Map<K,V> |
Value.toLinkedMap(Function<? super T,? extends Tuple2<? extends K,? extends V>> f)
Converts this to a
Map . |
default <K,V> Map<K,V> |
Value.toMap(Function<? super T,? extends K> keyMapper,
Function<? super T,? extends V> valueMapper)
Converts this to a
Map . |
default <K,V> Map<K,V> |
Value.toMap(Function<? super T,? extends Tuple2<? extends K,? extends V>> f)
Converts this to a
Map . |
Modifier and Type | Interface and Description |
---|---|
interface |
SortedMap<K,V>
An immutable
SortedMap interface. |
Modifier and Type | Class and Description |
---|---|
class |
HashMap<K,V>
An immutable
HashMap implementation based on a
Hash array mapped trie (HAMT). |
class |
LinkedHashMap<K,V>
An immutable
LinkedHashMap implementation that has predictable (insertion-order) iteration. |
class |
TreeMap<K,V>
SortedMap implementation, backed by a Red/Black Tree.
|
Modifier and Type | Method and Description |
---|---|
Map<K,Traversable<V>> |
Multimap.asMap()
Converts this
Multimap to a Map |
<K2,V2> Map<K2,V2> |
Map.bimap(Function<? super K,? extends K2> keyMapper,
Function<? super V,? extends V2> valueMapper)
Maps this
Map to a new Map with different component type by applying a function to its elements. |
Map<K,V> |
Map.distinct() |
Map<K,V> |
Map.distinctBy(Comparator<? super Tuple2<K,V>> comparator) |
<U> Map<K,V> |
Map.distinctBy(Function<? super Tuple2<K,V>,? extends U> keyExtractor) |
Map<K,V> |
Map.drop(int n) |
Map<K,V> |
Map.dropRight(int n) |
Map<K,V> |
Map.dropUntil(Predicate<? super Tuple2<K,V>> predicate) |
Map<K,V> |
Map.dropWhile(Predicate<? super Tuple2<K,V>> predicate) |
protected <K2,V2> Map<K2,V2> |
HashMultimap.emptyMapSupplier() |
protected <K2,V2> Map<K2,V2> |
TreeMultimap.emptyMapSupplier() |
protected <K2,V2> Map<K2,V2> |
LinkedHashMultimap.emptyMapSupplier() |
Map<K,V> |
Map.filter(BiPredicate<? super K,? super V> predicate)
Returns a new Map consisting of all elements which satisfy the given predicate.
|
Map<K,V> |
Map.filter(Predicate<? super Tuple2<K,V>> predicate) |
Map<K,V> |
Map.filterKeys(Predicate<? super K> predicate)
Returns a new Map consisting of all elements with keys which satisfy the given predicate.
|
Map<K,V> |
Map.filterValues(Predicate<? super V> predicate)
Returns a new Map consisting of all elements with values which satisfy the given predicate.
|
<K2,V2> Map<K2,V2> |
Map.flatMap(BiFunction<? super K,? super V,? extends Iterable<Tuple2<K2,V2>>> mapper)
FlatMaps this
Map to a new Map with different component type. |
<C> Map<C,CharSeq> |
CharSeq.groupBy(Function<? super Character,? extends C> classifier) |
<C> Map<C,? extends Set<T>> |
Set.groupBy(Function<? super T,? extends C> classifier) |
default <C> Map<C,Iterator<T>> |
Iterator.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,BitSet<T>> |
BitSet.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,? extends IndexedSeq<T>> |
IndexedSeq.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,? extends PriorityQueue<T>> |
PriorityQueue.groupBy(Function<? super T,? extends C> classifier) |
default <C> Map<C,Seq<T>> |
Tree.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,TreeSet<T>> |
TreeSet.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,Queue<T>> |
Queue.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,Vector<T>> |
Vector.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,? extends Seq<T>> |
Seq.groupBy(Function<? super T,? extends C> classifier) |
default <C> Map<C,List<T>> |
List.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,HashSet<T>> |
HashSet.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,LinkedHashSet<T>> |
LinkedHashSet.groupBy(Function<? super T,? extends C> classifier) |
default <C> Map<C,Stream<T>> |
Stream.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,? extends SortedSet<T>> |
SortedSet.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,Array<T>> |
Array.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,? extends Traversable<T>> |
Traversable.groupBy(Function<? super T,? extends C> classifier)
Groups this elements by classifying the elements.
|
<C> Map<C,? extends LinearSeq<T>> |
LinearSeq.groupBy(Function<? super T,? extends C> classifier) |
<C> Map<C,? extends SortedMultimap<K,V>> |
SortedMultimap.groupBy(Function<? super Tuple2<K,V>,? extends C> classifier) |
<C> Map<C,? extends Map<K,V>> |
Map.groupBy(Function<? super Tuple2<K,V>,? extends C> classifier) |
<C> Map<C,TreeMap<K,V>> |
TreeMap.groupBy(Function<? super Tuple2<K,V>,? extends C> classifier) |
<C> Map<C,LinkedHashMap<K,V>> |
LinkedHashMap.groupBy(Function<? super Tuple2<K,V>,? extends C> classifier) |
<C> Map<C,HashMap<K,V>> |
HashMap.groupBy(Function<? super Tuple2<K,V>,? extends C> classifier) |
<C> Map<C,? extends Multimap<K,V>> |
Multimap.groupBy(Function<? super Tuple2<K,V>,? extends C> classifier) |
<C> Map<C,? extends SortedMap<K,V>> |
SortedMap.groupBy(Function<? super Tuple2<K,V>,? extends C> classifier) |
Map<K,V> |
Map.init() |
<K2,V2> Map<K2,V2> |
Map.map(BiFunction<? super K,? super V,Tuple2<K2,V2>> mapper)
Maps the entries of this
Map to form a new Map . |
<K2> Map<K2,V> |
Map.mapKeys(Function<? super K,? extends K2> keyMapper)
Maps the keys of this
Map while preserving the corresponding values. |
<K2> Map<K2,V> |
Map.mapKeys(Function<? super K,? extends K2> keyMapper,
BiFunction<? super V,? super V,? extends V> valueMerge)
Maps the keys of this
Map while preserving the corresponding values and applying a value merge function on collisions. |
<V2> Map<K,V2> |
Map.mapValues(Function<? super V,? extends V2> valueMapper)
Maps the values of this
Map while preserving the corresponding keys. |
Map<K,V> |
Map.merge(Map<? extends K,? extends V> that)
Creates a new map which by merging the entries of
this map and that map. |
<U extends V> |
Map.merge(Map<? extends K,U> that,
BiFunction<? super V,? super U,? extends V> collisionResolution)
Creates a new map which by merging the entries of
this map and that map. |
static <K,V> Map<K,V> |
Map.narrow(Map<? extends K,? extends V> map)
Narrows a widened
Map<? extends K, ? extends V> to Map<K, V>
by performing a type-safe cast. |
Map<K,V> |
Map.orElse(Iterable<? extends Tuple2<K,V>> other) |
Map<K,V> |
Map.orElse(Supplier<? extends Iterable<? extends Tuple2<K,V>>> supplier) |
Map<K,V> |
Map.peek(Consumer<? super Tuple2<K,V>> action) |
<U extends V> |
Map.put(K key,
U value,
BiFunction<? super V,? super U,? extends V> merge)
Associates the specified value with the specified key in this map.
|
Map<K,V> |
Map.put(K key,
V value)
Associates the specified value with the specified key in this map.
|
Map<K,V> |
Map.put(Tuple2<? extends K,? extends V> entry)
Convenience method for
put(entry._1, entry._2) . |
<U extends V> |
Map.put(Tuple2<? extends K,U> entry,
BiFunction<? super V,? super U,? extends V> merge)
Convenience method for
put(entry._1, entry._2, merge) . |
Map<K,V> |
Map.reject(BiPredicate<? super K,? super V> predicate)
Returns a new Map consisting of all elements which do not satisfy the given predicate.
|
Map<K,V> |
Map.reject(Predicate<? super Tuple2<K,V>> predicate) |
Map<K,V> |
Map.rejectKeys(Predicate<? super K> predicate)
Returns a new Map consisting of all elements with keys which do not satisfy the given predicate.
|
Map<K,V> |
Map.rejectValues(Predicate<? super V> predicate)
Returns a new Map consisting of all elements with values which do not satisfy the given predicate.
|
Map<K,V> |
Map.remove(K key)
Removes the mapping for a key from this map if it is present.
|
Map<K,V> |
Map.removeAll(BiPredicate<? super K,? super V> predicate)
Deprecated.
Please use
reject(BiPredicate) |
Map<K,V> |
Map.removeAll(Iterable<? extends K> keys)
Removes the mapping for a key from this map if it is present.
|
Map<K,V> |
Map.removeKeys(Predicate<? super K> predicate)
Deprecated.
Please use
rejectKeys(Predicate) |
Map<K,V> |
Map.removeValues(Predicate<? super V> predicate)
Deprecated.
Please use
rejectValues(Predicate) |
Map<K,V> |
Map.replace(K key,
V oldValue,
V newValue)
Replaces the entry for the specified key only if currently mapped to the specified value.
|
Map<K,V> |
Map.replace(Tuple2<K,V> currentElement,
Tuple2<K,V> newElement) |
Map<K,V> |
Map.replaceAll(BiFunction<? super K,? super V,? extends V> function)
Replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception.
|
Map<K,V> |
Map.replaceAll(Tuple2<K,V> currentElement,
Tuple2<K,V> newElement) |
Map<K,V> |
Map.replaceValue(K key,
V value)
Replaces the entry for the specified key only if it is currently mapped to some value.
|
Map<K,V> |
Map.retainAll(Iterable<? extends Tuple2<K,V>> elements) |
Map<K,V> |
Map.scan(Tuple2<K,V> zero,
BiFunction<? super Tuple2<K,V>,? super Tuple2<K,V>,? extends Tuple2<K,V>> operation) |
Map<K,V> |
Map.tail() |
Map<K,V> |
Map.take(int n) |
Map<K,V> |
Map.takeRight(int n) |
Map<K,V> |
Map.takeUntil(Predicate<? super Tuple2<K,V>> predicate) |
Map<K,V> |
Map.takeWhile(Predicate<? super Tuple2<K,V>> predicate) |
Modifier and Type | Method and Description |
---|---|
default <K> Option<Map<K,T>> |
Traversable.arrangeBy(Function<? super T,? extends K> getKey)
Matches each element with a unique key that you extract from it.
|
Tuple2<V,? extends Map<K,V>> |
Map.computeIfAbsent(K key,
Function<? super K,? extends V> mappingFunction)
If the specified key is not already associated with a value,
attempts to compute its value using the given mapping
function and enters it into this map.
|
Tuple2<Option<V>,? extends Map<K,V>> |
Map.computeIfPresent(K key,
BiFunction<? super K,? super V,? extends V> remappingFunction)
If the value for the specified key is present, attempts to
compute a new mapping given the key and its current mapped value.
|
<C> Map<C,? extends Map<K,V>> |
Map.groupBy(Function<? super Tuple2<K,V>,? extends C> classifier) |
Iterator<? extends Map<K,V>> |
Map.grouped(int size) |
Option<? extends Map<K,V>> |
Map.initOption() |
Tuple2<? extends Map<K,V>,? extends Map<K,V>> |
Map.partition(Predicate<? super Tuple2<K,V>> predicate) |
Tuple2<? extends Map<K,V>,? extends Map<K,V>> |
Map.partition(Predicate<? super Tuple2<K,V>> predicate) |
Iterator<? extends Map<K,V>> |
Map.slideBy(Function<? super Tuple2<K,V>,?> classifier) |
Iterator<? extends Map<K,V>> |
Map.sliding(int size) |
Iterator<? extends Map<K,V>> |
Map.sliding(int size,
int step) |
Tuple2<? extends Map<K,V>,? extends Map<K,V>> |
Map.span(Predicate<? super Tuple2<K,V>> predicate) |
Tuple2<? extends Map<K,V>,? extends Map<K,V>> |
Map.span(Predicate<? super Tuple2<K,V>> predicate) |
Option<? extends Map<K,V>> |
Map.tailOption() |
Modifier and Type | Method and Description |
---|---|
protected <K2,V2> HashMultimap<K2,V2> |
HashMultimap.createFromMap(Map<K2,Traversable<V2>> back) |
protected <K2,V2> TreeMultimap<K2,V2> |
TreeMultimap.createFromMap(Map<K2,Traversable<V2>> back) |
protected <K2,V2> LinkedHashMultimap<K2,V2> |
LinkedHashMultimap.createFromMap(Map<K2,Traversable<V2>> back) |
Map<K,V> |
Map.merge(Map<? extends K,? extends V> that)
Creates a new map which by merging the entries of
this map and that map. |
TreeMap<K,V> |
TreeMap.merge(Map<? extends K,? extends V> that) |
LinkedHashMap<K,V> |
LinkedHashMap.merge(Map<? extends K,? extends V> that) |
HashMap<K,V> |
HashMap.merge(Map<? extends K,? extends V> that) |
SortedMap<K,V> |
SortedMap.merge(Map<? extends K,? extends V> that) |
<U extends V> |
Map.merge(Map<? extends K,U> that,
BiFunction<? super V,? super U,? extends V> collisionResolution)
Creates a new map which by merging the entries of
this map and that map. |
<U extends V> |
TreeMap.merge(Map<? extends K,U> that,
BiFunction<? super V,? super U,? extends V> collisionResolution) |
<U extends V> |
LinkedHashMap.merge(Map<? extends K,U> that,
BiFunction<? super V,? super U,? extends V> collisionResolution) |
<U extends V> |
HashMap.merge(Map<? extends K,U> that,
BiFunction<? super V,? super U,? extends V> collisionResolution) |
<U extends V> |
SortedMap.merge(Map<? extends K,U> that,
BiFunction<? super V,? super U,? extends V> collisionResolution) |
static <K,V> Map<K,V> |
Map.narrow(Map<? extends K,? extends V> map)
Narrows a widened
Map<? extends K, ? extends V> to Map<K, V>
by performing a type-safe cast. |
Modifier and Type | Method and Description |
---|---|
default <U> U |
Map.transform(Function<? super Map<K,V>,? extends U> f)
Transforms this
Map . |
Copyright © 2021. All Rights Reserved.