use of com.thoughtworks.go.plugin.access.common.MetadataStore in project gocd by gocd.
the class DefaultPluginInfoFinder method pluginInfoFor.
public CombinedPluginInfo pluginInfoFor(String pluginId) {
CombinedPluginInfo result = new CombinedPluginInfo();
List<PluginInfo> allPluginInfosForPluginID = builders.values().stream().map(new Function<MetadataStore, PluginInfo>() {
@Override
public PluginInfo apply(MetadataStore metadataStore) {
return metadataStore.getPluginInfo(pluginId);
}
}).filter(new Predicate<PluginInfo>() {
@Override
public boolean test(PluginInfo obj) {
return Objects.nonNull(obj);
}
}).collect(toList());
if (allPluginInfosForPluginID.isEmpty()) {
return null;
}
result.addAll(allPluginInfosForPluginID);
return result;
}
Aggregations