[New] Added putAll and addAll to MapOf* collections

This commit is contained in:
Robert von Burg 2017-03-27 11:50:18 +02:00
parent 16f16c330b
commit 2bc76ca79b
3 changed files with 21 additions and 0 deletions

View File

@ -121,4 +121,11 @@ public class MapOfLists<T, U> {
public boolean isEmpty() {
return this.mapOfLists.isEmpty();
}
public MapOfLists<T, U> addAll(MapOfLists<T, U> other) {
for (T key : other.keySet()) {
addList(key, other.getList(key));
}
return this;
}
}

View File

@ -169,4 +169,11 @@ public class MapOfMaps<T, U, V> {
public boolean isEmpty() {
return this.mapOfMaps.isEmpty();
}
public MapOfMaps<T, U, V> putAll(MapOfMaps<T, U, V> other) {
for (T key : other.keySet()) {
addMap(key, other.getMap(key));
}
return this;
}
}

View File

@ -120,4 +120,11 @@ public class MapOfSets<T, U> {
public boolean isEmpty() {
return this.mapOfSets.isEmpty();
}
public MapOfSets<T, U> addAll(MapOfSets<T, U> other) {
for (T key : other.keySet()) {
addSet(key, other.getSet(key));
}
return this;
}
}