public final class TestVersionConstraint extends java.lang.Object implements VersionConstraint
Modifier and Type | Field and Description |
---|---|
private VersionRange |
range |
private Version |
version |
Constructor and Description |
---|
TestVersionConstraint(Version version)
Creates a version constraint from the specified version.
|
TestVersionConstraint(VersionRange range)
Creates a version constraint from the specified version range.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsVersion(Version version)
Determines whether the specified version satisfies this constraint.
|
boolean |
equals(java.lang.Object obj) |
VersionRange |
getRange()
Gets the version range of this constraint.
|
Version |
getVersion()
Gets the version recommended by this constraint.
|
private static int |
hash(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
toString() |
private final VersionRange range
private final Version version
public TestVersionConstraint(VersionRange range)
range
- The version range, must not be null
.public TestVersionConstraint(Version version)
version
- The version, must not be null
.public VersionRange getRange()
VersionConstraint
getRange
in interface VersionConstraint
null
if none.public Version getVersion()
VersionConstraint
getVersion
in interface VersionConstraint
null
if none.public boolean containsVersion(Version version)
VersionConstraint
containsVersion
in interface VersionConstraint
version
- The version to test, must not be null
.true
if the specified version satisfies this constraint, false
otherwise.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
private static int hash(java.lang.Object obj)