aQute.lib.promise.PromiseCollectors Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.bndtools.templating.gitrepo Show documentation
Show all versions of org.bndtools.templating.gitrepo Show documentation
org.bndtools.templating.gitrepo
package aQute.lib.promise;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collector;
import org.osgi.util.promise.Promise;
import org.osgi.util.promise.PromiseFactory;
public class PromiseCollectors {
private PromiseCollectors() {}
public static Collector, List>, Promise>> toPromise(
PromiseFactory promiseFactory) {
return Collector.of(ArrayList::new, List::add, PromiseCollectors::combiner, promiseFactory::all);
}
private static > C combiner(C t, C u) {
t.addAll(u);
return t;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy