add collection update link if atleast one plugin is updatable

This commit is contained in:
Eduard Heimbuch
2019-09-27 16:07:25 +02:00
parent 2acad5936b
commit e1dd393cce
4 changed files with 41 additions and 11 deletions

View File

@@ -139,6 +139,14 @@ public class DefaultPluginManager implements PluginManager {
.collect(Collectors.toList());
}
@Override
public List<InstalledPlugin> getUpdatable() {
return getInstalled()
.stream()
.filter(p -> isUpdatable(p.getDescriptor().getInformation().getName()))
.collect(Collectors.toList());
}
private <T extends Plugin> Predicate<T> filterByName(String name) {
return plugin -> name.equals(plugin.getDescriptor().getInformation().getName());
}