public class VersionRange extends VersionRange
Modifier and Type | Field and Description |
---|---|
static VersionRange |
emptyRange
An empty version range: "0.0.0".
|
LEFT_CLOSED, LEFT_OPEN, RIGHT_CLOSED, RIGHT_OPEN
Constructor and Description |
---|
VersionRange(String versionRange)
Creates a version range from the specified string.
|
VersionRange(Version minVersion,
boolean includeMin,
Version maxVersion,
boolean includeMax)
Constructs a VersionRange with the specified minVersion and maxVersion.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getIncludeMaximum()
Indicates if the maximum version is included in the version range.
|
boolean |
getIncludeMinimum()
Indicates if the minimum version is included in the version range.
|
Version |
getMaximum()
Deprecated.
|
Version |
getMinimum()
Returns the minimum Version of this VersionRange.
|
boolean |
isIncluded(Version version)
Returns whether the given version is included in this VersionRange.
|
equals, getLeft, getLeftType, getRight, getRightType, hashCode, includes, intersection, isEmpty, isExact, toFilterString, toString
public static final VersionRange emptyRange
public VersionRange(Version minVersion, boolean includeMin, Version maxVersion, boolean includeMax)
minVersion
- the minimum version of the range. If null
then Version.emptyVersion
is used.maxVersion
- the maximum version of the range. If null
then new Version(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE)
is used.public VersionRange(String versionRange)
Here is the grammar for version range strings.
version-range ::= interval | atleast interval ::= ( include-min | exclude-min ) min-version ',' max-version ( include-max | exclude-max ) atleast ::= version floor ::= version ceiling ::= version include-min ::= '[' exclude-min ::= '(' include-max ::= ']' exclude-max ::= ')'
versionRange
- string representation of the version range or null
for the empty range "0.0.0"definition of version
public Version getMinimum()
public boolean getIncludeMinimum()
public Version getMaximum()
VersionRange.getRight()
This method is deprecated. For ranges that have no maximum this method
incorrectly returns a version equal to
Version(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE)
.
Use VersionRange.getRight()
instead.
public boolean getIncludeMaximum()
public boolean isIncluded(Version version)
version
- a version to be tested for inclusion in this VersionRange.
If null
then Version.emptyVersion
is used.true
if the version is included,
false
otherwiseCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.