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 void
add(TK key, TV value)
void
addAll(MultiMapDecorator<TK,TV,TC> map)
void
addAll(TK key, Collection<? extends TV> values)
void
addEmpty(TK key)
void
clear()
boolean
containsKey(TK key)
protected abstract TC
createEmptyCollection()
Set<Map.Entry<TK,TC>>
entrySet()
Collection<TV>
getValues(TK key)
boolean
isEmpty()
Set<TK>
keySet()
void
remove(TK key, TV v)
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.TC
removeKey(TK key)
void
removeValue(TV v)
int
size()
String
toString()
Collection<TC>
values()
int
valuesSize()
-
-
-
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()
-
-