improve wrapper and general structure #16

Merged
tueem merged 23 commits from improve/structure into dev 2025-03-17 08:26:44 +00:00
Showing only changes of commit 78cacb7eb6 - Show all commits

View File

@ -0,0 +1,15 @@
package net.tomatentum.marinara.util;
import java.util.ArrayList;
import java.util.function.Function;
public class ObjectListAggregator<O, K, V> extends ObjectAggregator<O, K, ArrayList<V>> {
public ObjectListAggregator(Function<O, K> keySupplier, Function<O, V> valueConsumer) {
super(keySupplier,
(l, o) -> l.add(valueConsumer.apply(o)),
() -> new ArrayList<>());
}
}