use of org.fagu.fmv.soft.find.SoftPolicy in project fmv by f-agu.
the class VersionSoftPolicy method byProperties.
/**
* @param versionSoftInfo
* @return
*/
private SoftFound byProperties(VersionSoftInfo versionSoftInfo) {
Optional<String> propertyMinVersion = getProperty(versionSoftInfo, "minversion");
if (propertyMinVersion.isPresent()) {
Version minVersion = Version.parse(propertyMinVersion.get());
SoftPolicy onAllPlatforms = new VersionSoftPolicy().onAllPlatforms(minVersion(minVersion));
return ((VersionSoftPolicy) onAllPlatforms).byDefined(versionSoftInfo);
}
return null;
}
use of org.fagu.fmv.soft.find.SoftPolicy in project fmv by f-agu.
the class PdfSoftProvider method getDefaultSoftPolicy.
// ***********************************************************************
/**
* @return
*/
private static SoftPolicy getDefaultSoftPolicy() {
Version v012 = new Version(0, 12);
BiPredicate<SoftInfo, Provider> isProvider = (s, p) -> s instanceof XPdfVersionSoftInfo && ((XPdfVersionSoftInfo) s).getProvider() == p;
return new VersionSoftPolicy().on("xpdf", s -> isProvider.test(s, Provider.XPDF), minVersion(Version.V3)).on("poppler", s -> isProvider.test(s, Provider.POPPLER), minVersion(v012)).onAllPlatforms(minVersion(v012));
}
Aggregations