Class TestVersionConstraint
java.lang.Object
org.eclipse.aether.internal.test.util.TestVersionConstraint
- All Implemented Interfaces:
VersionConstraint
A constraint on versions for a dependency.
-
Constructor Summary
ConstructorDescriptionTestVersionConstraint
(Version version) Creates a version constraint from the specified version.Creates a version constraint from the specified version range. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsVersion
(Version version) Determines whether the specified version satisfies this constraint.boolean
getRange()
Gets the version range of this constraint.Gets the version recommended by this constraint.int
hashCode()
toString()
-
Constructor Details
-
TestVersionConstraint
Creates a version constraint from the specified version range.- Parameters:
range
- The version range, must not benull
.
-
TestVersionConstraint
Creates a version constraint from the specified version.- Parameters:
version
- The version, must not benull
.
-
-
Method Details
-
getRange
Description copied from interface:VersionConstraint
Gets the version range of this constraint.- Specified by:
getRange
in interfaceVersionConstraint
- Returns:
- The version range or
null
if none.
-
getVersion
Description copied from interface:VersionConstraint
Gets the version recommended by this constraint.- Specified by:
getVersion
in interfaceVersionConstraint
- Returns:
- The recommended version or
null
if none.
-
containsVersion
Description copied from interface:VersionConstraint
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.- Specified by:
containsVersion
in interfaceVersionConstraint
- Parameters:
version
- The version to test, must not benull
.- Returns:
true
if the specified version satisfies this constraint,false
otherwise.
-
toString
-
equals
-
hashCode
-