Class TestVersionRange
java.lang.Object
org.eclipse.aether.internal.test.util.TestVersionRange
- All Implemented Interfaces:
VersionRange
A version range inspired by mathematical range syntax. For example, "[1.0,2.0)", "[1.0,)" or "[1.0]".
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.aether.version.VersionRange
VersionRange.Bound
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTestVersionRange
(String range) Creates a version range from the specified range specification. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
containsVersion
(Version version) Determines whether the specified version is contained within this range.boolean
Gets a lower bound (if any) for this range.Gets an upper bound (if any) for this range.private static int
int
hashCode()
private boolean
isSnapshot
(Version version) toString()
-
Field Details
-
lowerBound
-
lowerBoundInclusive
private final boolean lowerBoundInclusive -
upperBound
-
upperBoundInclusive
private final boolean upperBoundInclusive
-
-
Constructor Details
-
TestVersionRange
TestVersionRange(String range) throws InvalidVersionSpecificationException Creates a version range from the specified range specification.- Parameters:
range
- The range specification to parse, must not benull
.- Throws:
InvalidVersionSpecificationException
- If the range could not be parsed.
-
-
Method Details
-
getLowerBound
Description copied from interface:VersionRange
Gets a lower bound (if any) for this range. If existent, this range does not contain any version smaller than its lower bound. Note that complex version ranges might exclude some versions even within their bounds.- Specified by:
getLowerBound
in interfaceVersionRange
- Returns:
- A lower bound for this range or
null
is there is none.
-
getUpperBound
Description copied from interface:VersionRange
Gets an upper bound (if any) for this range. If existent, this range does not contain any version greater than its upper bound. Note that complex version ranges might exclude some versions even within their bounds.- Specified by:
getUpperBound
in interfaceVersionRange
- Returns:
- An upper bound for this range or
null
is there is none.
-
acceptsSnapshots
public boolean acceptsSnapshots() -
containsVersion
Description copied from interface:VersionRange
Determines whether the specified version is contained within this range.- Specified by:
containsVersion
in interfaceVersionRange
- Parameters:
version
- The version to test, must not benull
.- Returns:
true
if this range contains the specified version,false
otherwise.
-
isSnapshot
-
equals
-
hashCode
public int hashCode() -
hash
-
toString
-