final class TestVersionRange extends java.lang.Object implements VersionRange
VersionRange.Bound
Modifier and Type | Field and Description |
---|---|
private Version |
lowerBound |
private boolean |
lowerBoundInclusive |
private Version |
upperBound |
private boolean |
upperBoundInclusive |
Constructor and Description |
---|
TestVersionRange(java.lang.String range)
Creates a version range from the specified range specification.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsSnapshots() |
boolean |
containsVersion(Version version)
Determines whether the specified version is contained within this range.
|
boolean |
equals(java.lang.Object obj) |
VersionRange.Bound |
getLowerBound()
Gets a lower bound (if any) for this range.
|
VersionRange.Bound |
getUpperBound()
Gets an upper bound (if any) for this range.
|
private static int |
hash(java.lang.Object obj) |
int |
hashCode() |
private boolean |
isSnapshot(Version version) |
java.lang.String |
toString() |
private final Version lowerBound
private final boolean lowerBoundInclusive
private final Version upperBound
private final boolean upperBoundInclusive
TestVersionRange(java.lang.String range) throws InvalidVersionSpecificationException
range
- The range specification to parse, must not be null
.InvalidVersionSpecificationException
- If the range could not be parsed.public VersionRange.Bound getLowerBound()
VersionRange
getLowerBound
in interface VersionRange
null
is there is none.public VersionRange.Bound getUpperBound()
VersionRange
getUpperBound
in interface VersionRange
null
is there is none.public boolean acceptsSnapshots()
public boolean containsVersion(Version version)
VersionRange
containsVersion
in interface VersionRange
version
- The version to test, must not be null
.true
if this range contains the specified version, false
otherwise.private boolean isSnapshot(Version version)
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)
public java.lang.String toString()
toString
in class java.lang.Object