[New] Added stream() to MapOf* classes

This commit is contained in:
Robert von Burg 2022-02-24 15:29:24 +01:00
parent 48e4fad9d0
commit 844bddeefc
2 changed files with 8 additions and 0 deletions

View File

@ -172,6 +172,10 @@ public class MapOfLists<T, U> {
return this.mapOfLists.values().stream().flatMap(Collection::stream);
}
public Stream<Entry<T, List<U>>> stream() {
return this.mapOfLists.entrySet().stream();
}
@Override
public boolean equals(Object o) {
if (this == o)

View File

@ -190,6 +190,10 @@ public class MapOfSets<T, U> {
return this.mapOfSets.values().stream().flatMap(Collection::stream);
}
public Stream<Entry<T, Set<U>>> stream() {
return this.mapOfSets.entrySet().stream();
}
@Override
public boolean equals(Object o) {
if (this == o)