public interface VersionUtils
Provides a set of utilities to work with artifact versions.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsVersion(String version, List<String> constraints) Determines whether the specified version satisfies this constraint.static VersionUtilsdiscoverVersionUtils(ClassLoader classLoader) Discovers aVersionUtilsthrough SPI.
-
Method Details
-
containsVersion
Determines whether the specified version satisfies this constraint. In more detail, a version satisfies this constraint if it matches its version range or if this constraint has no version range and the specified version equals the version recommended by the constraint.- Parameters:
version- The version to test, must not benull.constraints- The versions to test against, must not benull.- Returns:
trueif the specified version satisfies any of the constraints,falseotherwise.- Throws:
IllegalArgumentException
-
discoverVersionUtils
Discovers aVersionUtilsthrough SPI.- Returns:
- a new version utility.
- Since:
- 2.0
-