Class TestVersionConstraint
- java.lang.Object
-
- org.eclipse.aether.internal.test.util.TestVersionConstraint
-
- All Implemented Interfaces:
VersionConstraint
final class TestVersionConstraint extends java.lang.Object implements VersionConstraint
A constraint on versions for a dependency.
-
-
Field Summary
Fields Modifier and Type Field Description private VersionRangerangeprivate Versionversion
-
Constructor Summary
Constructors Constructor Description TestVersionConstraint(Version version)Creates a version constraint from the specified version.TestVersionConstraint(VersionRange range)Creates a version constraint from the specified version range.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsVersion(Version version)Determines whether the specified version satisfies this constraint.booleanequals(java.lang.Object obj)VersionRangegetRange()Gets the version range of this constraint.VersiongetVersion()Gets the version recommended by this constraint.private static inthash(java.lang.Object obj)inthashCode()java.lang.StringtoString()
-
-
-
Field Detail
-
range
private final VersionRange range
-
version
private final Version version
-
-
Constructor Detail
-
TestVersionConstraint
TestVersionConstraint(VersionRange range)
Creates a version constraint from the specified version range.- Parameters:
range- The version range, must not benull.
-
TestVersionConstraint
TestVersionConstraint(Version version)
Creates a version constraint from the specified version.- Parameters:
version- The version, must not benull.
-
-
Method Detail
-
getRange
public VersionRange getRange()
Description copied from interface:VersionConstraintGets the version range of this constraint.- Specified by:
getRangein interfaceVersionConstraint- Returns:
- The version range or
nullif none.
-
getVersion
public Version getVersion()
Description copied from interface:VersionConstraintGets the version recommended by this constraint.- Specified by:
getVersionin interfaceVersionConstraint- Returns:
- The recommended version or
nullif none.
-
containsVersion
public boolean containsVersion(Version version)
Description copied from interface:VersionConstraintDetermines 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:
containsVersionin interfaceVersionConstraint- Parameters:
version- The version to test, must not benull.- Returns:
trueif the specified version satisfies this constraint,falseotherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
hash
private static int hash(java.lang.Object obj)
-
-