
aQute.bnd.service.Registry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of biz.aQute.bndlib Show documentation
Show all versions of biz.aQute.bndlib Show documentation
bndlib: A Swiss Army Knife for OSGi
The newest version!
package aQute.bnd.service;
import java.util.List;
import java.util.stream.Collectors;
import aQute.bnd.service.tags.Tagged;
/**
* A registry for objects.
*/
public interface Registry {
/**
* @param
* @param c
* @return all plugins matching the given class
*/
List getPlugins(Class c);
/**
* @param
* @param c
* @param tags
* @return All plugins that have a tag that matches at least one of the
* given tags or have no tags.
*/
default List getPlugins(Class c, String... tags) {
if (tags.length == 0) {
return getPlugins(c);
}
return getPlugins(c).stream()
.filter(plugin -> (plugin instanceof Tagged taggedPlugin) ? taggedPlugin.getTags()
.includesAny(tags) : true)
.collect(Collectors.toList());
}
T getPlugin(Class c);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy