Skip to content

Commit 13b5cba

Browse files
pawelkrupinskims-tg
authored andcommitted
Add HashMap#foreach
1 parent f47f3ee commit 13b5cba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/main/java/fj/data/HashMap.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,14 @@ public <B> HashMap<K, B> mapValues(F<V, B> function) {
288288
return map(Function.<K>identity(), function, e, h);
289289
}
290290

291+
public void foreach(Effect<P2<K, V>> effect) {
292+
toStream().foreach(effect);
293+
}
294+
295+
public void foreach(F<P2<K, V>, Unit> function) {
296+
toStream().foreach(function);
297+
}
298+
291299
public List<P2<K, V>> toList() {
292300
return keys().map(new F<K, P2<K, V>>() {
293301
public P2<K, V> f(final K k) {

0 commit comments

Comments
 (0)