final class GenericVersionRange extends java.lang.Object implements VersionRange
VersionRange.Bound
Modifier and Type | Field and Description |
---|---|
private VersionRange.Bound |
lowerBound |
private VersionRange.Bound |
upperBound |
Constructor and Description |
---|
GenericVersionRange(java.lang.String range)
Creates a version range from the specified range specification.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsVersion(Version version)
Determines whether the specified version is contained within this range.
|
private static <T> boolean |
eq(T s1,
T s2) |
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 Version |
parse(java.lang.String version) |
java.lang.String |
toString() |
private final VersionRange.Bound lowerBound
private final VersionRange.Bound upperBound
public GenericVersionRange(java.lang.String range) throws InvalidVersionSpecificationException
range
- The range specification to parse, must not be null
.InvalidVersionSpecificationException
- If the range could not be parsed.private Version parse(java.lang.String version)
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 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.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
private static <T> boolean eq(T s1, T s2)
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