Class ImmutableListMultimap<K,V>
java.lang.Object
com.atlassian.bamboo.utils.collection.multimap.ImmutableListMultimap<K,V>
- All Implemented Interfaces:
ImmutableMultimap<K,
V>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMap<K,
Collection<V>> asMap()
Returns a view of the mappings contained in this multimap as a map from each key to its corresponding values.boolean
containsKey
(K key) Returnstrue
if this multimap contains one or more keys to the specified value.copy()
Creates a deep copy of this multimap.static <K,
V> ImmutableListMultimap<K, V> create()
entries()
Returns a collection view of all key-value pairs contained in this multimap.boolean
Retrieves the collection of values associated with the specified key in this multimap.int
hashCode()
inverse()
Creates an inverse view of this multimap.boolean
isEmpty()
Returnstrue
if this multimap contains no key-value mappings.keySet()
Returns the set of keys contained in this multimap.static <K,
V> ImmutableListMultimap<K, V> of
(Collection<Pair<K, V>> input) static <K,
V> ImmutableListMultimap<K, V> of
(K key, V value) int
size()
Returns the total number of key-value pairs in the multimap.values()
Returns a collection view of all values associated with keys in this multimap.
-
Constructor Details
-
ImmutableListMultimap
public ImmutableListMultimap()
-
-
Method Details
-
create
-
of
-
of
-
get
Description copied from interface:ImmutableMultimap
Retrieves the collection of values associated with the specified key in this multimap.- Specified by:
get
in interfaceImmutableMultimap<K,
V> - Parameters:
key
- the key whose associated values are to be returned- Returns:
- the collection of values associated with the specified key, or an empty collection if no values are associated with the key
-
keySet
Description copied from interface:ImmutableMultimap
Returns the set of keys contained in this multimap.- Specified by:
keySet
in interfaceImmutableMultimap<K,
V> - Returns:
- the set of keys contained in this multimap
-
containsKey
Description copied from interface:ImmutableMultimap
Returnstrue
if this multimap contains one or more keys to the specified value.- Specified by:
containsKey
in interfaceImmutableMultimap<K,
V> - Parameters:
key
- key whose presence in this multimap is to be tested- Returns:
true
if this multimap contains a mapping for the specified key
-
values
Description copied from interface:ImmutableMultimap
Returns a collection view of all values associated with keys in this multimap.- Specified by:
values
in interfaceImmutableMultimap<K,
V> - Returns:
- a collection view of all values contained in this multimap
-
isEmpty
public boolean isEmpty()Description copied from interface:ImmutableMultimap
Returnstrue
if this multimap contains no key-value mappings.- Specified by:
isEmpty
in interfaceImmutableMultimap<K,
V> - Returns:
true
if this multimap contains no key-value mappings
-
asMap
Description copied from interface:ImmutableMultimap
Returns a view of the mappings contained in this multimap as a map from each key to its corresponding values.- Specified by:
asMap
in interfaceImmutableMultimap<K,
V> - Returns:
- a map view of the mappings contained in this multimap
-
entries
Description copied from interface:ImmutableMultimap
Returns a collection view of all key-value pairs contained in this multimap. Each key-value pair is represented as a Map.Entry. If the multimap allows duplicate values, a separate Map.Entry will be included for each duplicate value.- Specified by:
entries
in interfaceImmutableMultimap<K,
V> - Returns:
- a collection view of all key-value pairs contained in this multimap
-
size
public int size()Description copied from interface:ImmutableMultimap
Returns the total number of key-value pairs in the multimap.- Specified by:
size
in interfaceImmutableMultimap<K,
V> - Returns:
- the total number of key-value pairs
-
copy
Description copied from interface:ImmutableMultimap
Creates a deep copy of this multimap.- Specified by:
copy
in interfaceImmutableMultimap<K,
V> - Returns:
- a new multimap instance containing the same key-value mappings as this multimap
-
inverse
Description copied from interface:ImmutableMultimap
Creates an inverse view of this multimap. In the inverse multimap, each value in the original multimap becomes a key in the new multimap, and each key in the original becomes part of the set of values associated with the new key. The inverse multimap is also immutable.- Specified by:
inverse
in interfaceImmutableMultimap<K,
V> - Returns:
- a new ImmutableMultimap instance where the roles of keys and values are swapped
-
equals
-
hashCode
public int hashCode()
-