java.lang.Object
me.sbasalaev.collection.Multimap<K,V,Opt<V>>
me.sbasalaev.collection.Map<K,V>
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
MutableMap
Mapping of keys to values.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> Map.Builder <K, V> build()Builds map from given entries.clone()Returns shallow immutable copy of this map.Associations between keys and collections of values in this multimap.static <K,V> Map <K, V> empty()Map with no entries.entries()The set of key-value associations in this map.booleanWhether some object is equal to this map.voidforEachEntry(BiConsumer<K, @Out V> action) Performs given action for each entry in this map.static <K,V> Map <K, V> Map view of given java map.Value associated with given key or empty optional if there is none.keys()The set of keys that have an associated value in this map.intkeySize()Number of keys in this map.View of this map with given mapping applied to values.static <K,V> Map <K, V> of(K key, V value) Map containing given entry.static <K,V> Map <K, V> of(K k1, V v1, K k2, V v2) Map containing given entries.static <K,V> Map <K, V> of(K k1, V v1, K k2, V v2, K k3, V v3) Map containing given entries.static <K,V> Map <K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) Map containing given entries.static <K,V> Map <K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) Map containing given entries.static <K,V> Map <K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Map containing given entries.toJava()View of this map as java map.Methods inherited from class me.sbasalaev.collection.Multimap
containsEntry, containsEntry, containsKey, hashCode, isEmpty, nonEmpty, size, toString, values
-
Constructor Details
-
Map
public Map()Constructor for subclasses.
-
-
Method Details
-
empty
Map with no entries. -
of
Map containing given entry. -
of
Map containing given entries. -
of
Map containing given entries. -
of
Map containing given entries. -
of
Map containing given entries. -
of
public static <K,V> Map<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Map containing given entries. -
build
Builds map from given entries. -
fromJava
Map view of given java map. -
get
Value associated with given key or empty optional if there is none. -
keySize
public int keySize()Number of keys in this map. For the map this method returns the same value assize(). -
entries
The set of key-value associations in this map. -
collectionEntries
Description copied from class:MultimapAssociations between keys and collections of values in this multimap. -
keys
The set of keys that have an associated value in this map. -
mapValues
View of this map with given mapping applied to values. -
forEachEntry
Performs given action for each entry in this map.- Since:
- 4.1
-
toJava
View of this map as java map. -
clone
Returns shallow immutable copy of this map. -
equals
Whether some object is equal to this map. Two maps are equal if they contain the same entries, i.e. theirentries()methods return equal sets.
-