Package org.apache.maven.api
Interface VersionConstraint
Version constraint for dependency.
Constraint is either a range ("[1,2)") or recommended version ("1.0").
VersionConstraint
objects are created using the
VersionParser service.- Since:
- 4.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionasString()
Returns a string representation of this version constraintboolean
Determines whether the specified version is contained within this constraint.Returns the recommended version of this constraint, ornull
if none.Returns the range of this constraint, ornull
if none.
-
Method Details
-
getVersionRange
Returns the range of this constraint, ornull
if none.Note: only one, this method or
getRecommendedVersion()
method must return non-null
value. -
getRecommendedVersion
Returns the recommended version of this constraint, ornull
if none.Note: only one, this method or
getVersionRange()
method must return non-null
value. -
contains
Determines whether the specified version is contained within this constraint.- Parameters:
version
- the version to test, must not benull
- Returns:
true
if this range contains the specified version,false
otherwise
-
asString
Returns a string representation of this version constraint- Returns:
- the string representation of this version constraint
-