Class MultiMapDecorator<TK,TV,TC extends Collection<TV>>
- java.lang.Object
-
- jetbrains.buildServer.dataStructures.MultiMapDecorator<TK,TV,TC>
-
- Direct Known Subclasses:
LinkedMultiMapToList,MultiMapToList,MultiMapToSet
public abstract class MultiMapDecorator<TK,TV,TC extends Collection<TV>> extends Object
Handy decoration that can be used to create multi map
-
-
Constructor Summary
Constructors Constructor Description MultiMapDecorator(Map<TK,TC> map)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(TK key, TV value)voidaddAll(MultiMapDecorator<TK,TV,TC> map)voidaddAll(TK key, Collection<? extends TV> values)voidaddEmpty(TK key)voidclear()booleancontainsKey(TK key)protected abstract TCcreateEmptyCollection()Set<Map.Entry<TK,TC>>entrySet()Collection<TV>getValues(TK key)booleanisEmpty()Set<TK>keySet()voidremove(TK key, TV v)voidremoveAll(TK key, Collection<TV> values)Removes the specified values from the collection associated with the given key, if the key exists in the multimap.TCremoveKey(TK key)voidremoveValue(TV v)intsize()StringtoString()Collection<TC>values()intvaluesSize()
-
-
-
Field Detail
-
myMap
protected final Map<TK,TC extends Collection<TV>> myMap
-
-
Method Detail
-
addEmpty
public void addEmpty(TK key)
-
getValues
@NotNull public Collection<TV> getValues(TK key)
-
containsKey
public boolean containsKey(TK key)
-
clear
public void clear()
-
values
@NotNull public Collection<TC> values()
-
size
public int size()
-
valuesSize
public int valuesSize()
- Returns:
- count of values in the multi-map
- Since:
- 8.1
-
isEmpty
public boolean isEmpty()
-
removeValue
public void removeValue(TV v)
-
removeAll
public void removeAll(TK key, Collection<TV> values)
Removes the specified values from the collection associated with the given key, if the key exists in the multimap.- Parameters:
key- the key identifying the collection to remove values fromvalues- the values to be removed from the collection- Since:
- 2024.03
-
addAll
public void addAll(TK key, @NotNull Collection<? extends TV> values)
-
addAll
public void addAll(@NotNull MultiMapDecorator<TK,TV,TC> map)
-
createEmptyCollection
@NotNull protected abstract TC createEmptyCollection()
-
-