Class DefaultVersionManager
java.lang.Object
org.pf4j.DefaultVersionManager
- All Implemented Interfaces:
VersionManager
Default implementation for
VersionManager.
This implementation uses jSemVer (a Java implementation of the SemVer Specification).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckVersionConstraint(String version, String constraint) Checks if a version satisfies the specified SemVerExpressionstring.intcompareVersions(String v1, String v2) Compare two versions.
-
Constructor Details
-
DefaultVersionManager
public DefaultVersionManager()
-
-
Method Details
-
checkVersionConstraint
Checks if a version satisfies the specified SemVerExpressionstring. If the constraint is empty or null then the method returns true. Constraint examples:>2.0.0(simple),">=1.4.0 & <1.6.0"(range). See https://github.com/zafarkhaja/jsemver#semver-expressions-api-ranges for more info.- Specified by:
checkVersionConstraintin interfaceVersionManager- Parameters:
version-constraint-- Returns:
-
compareVersions
Description copied from interface:VersionManagerCompare two versions. It's similar withComparator.compare(Object, Object).- Specified by:
compareVersionsin interfaceVersionManager- Parameters:
v1-v2-
-