public class VersionRange
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
VersionRange(java.lang.String versionRange)
This constructor assumes that the string is a version range in format "[Version String] - [Version String]" It splits the string by the "-"
delimiter and attempts to create the range the same way as constructor
VersionRange(String, String) would. |
VersionRange(java.lang.String fromVersion,
java.lang.String toVersion)
This constructor constructs the Range with its lower and upper limits.
|
VersionRange(java.lang.String fromVersion,
Version toVersion)
This constructor constructs the Range with its lower and upper limits.
|
VersionRange(Version ver)
This constructor creates the Range with the same lower and upper limits
|
VersionRange(Version fromVersion,
java.lang.String toVersion)
This constructor constructs the Range with its lower and upper limits.
|
VersionRange(Version fromVersion,
Version toVersion)
This constructor constructs the Range with its lower and upper limits
|
Modifier and Type | Method and Description |
---|---|
Version |
getFromVersion() |
Version |
getToVersion() |
boolean |
isAboveRange(java.lang.String ver)
Converts the String into Version and than checks if the ver is above the range
|
boolean |
isAboveRange(Version ver)
Checks if the ver is above the range
|
boolean |
isBellowRange(Version ver)
Checks if the ver is below the range
|
boolean |
isBelowRange(java.lang.String ver)
Converts the String into Version and than checks if the ver is below the range
|
boolean |
isInRange(java.lang.String ver)
This method first converts String parameter into Version and checks if the version falls within range.
|
boolean |
isInRange(Version ver)
This method checks if the version falls within range.
|
boolean |
isOverlap(VersionRange otherRange) |
java.lang.String |
toString() |
public VersionRange(Version fromVersion, Version toVersion) throws InvalidVersionRangeException
fromVersion
- Version that contains lower limit of the rangetoVersion
- Version that contains upper limit of the rangeInvalidVersionRangeException
- if lower limit of the range is greater than upper limitpublic VersionRange(java.lang.String fromVersion, java.lang.String toVersion) throws InvalidVersionRangeException, InvalidVersionFormatException
fromVersion
- String that contains lower limit of the rangetoVersion
- String that contains upper limit of the rangeInvalidVersionRangeException
- if lower limit of the range is greater than upper limitInvalidVersionFormatException
- if one of the Strings is not a valid versionpublic VersionRange(Version fromVersion, java.lang.String toVersion) throws InvalidVersionRangeException, InvalidVersionFormatException
fromVersion
- String that contains lower limit of the rangetoVersion
- String that contains upper limit of the rangeInvalidVersionRangeException
- if lower limit of the range is greater than upper limitInvalidVersionFormatException
- if String parameter is not a valid versionpublic VersionRange(java.lang.String fromVersion, Version toVersion) throws InvalidVersionRangeException, InvalidVersionFormatException
fromVersion
- String that contains lower limit of the rangetoVersion
- String that contains upper limit of the rangeInvalidVersionRangeException
- if lower limit of the range is greater than upper limitInvalidVersionFormatException
- if String parameter is not a valid versionpublic VersionRange(Version ver) throws InvalidVersionRangeException
ver
- String that holds a single versionInvalidVersionRangeException
- if parameter is nullpublic VersionRange(java.lang.String versionRange) throws InvalidVersionRangeException, InvalidVersionFormatException
VersionRange(String, String)
would. If the original String
contains only one version without a delimiter (i.e. "[Version String]") the attempt is made to convert this String into single Version object
and than to create VersionRange with the same lower and upper limitsversionRange
- String in format "[Version String] - [Version String]" or "[Version String]"InvalidVersionRangeException
- if lower limit of the range is greater than upper limitInvalidVersionFormatException
- if String parameter is not a valid versionpublic Version getFromVersion()
public Version getToVersion()
public boolean isInRange(Version ver)
ver
- Version to be checkedpublic boolean isInRange(java.lang.String ver) throws InvalidVersionFormatException
ver
- String that contains Version value to be checkedInvalidVersionFormatException
- if String is not a valid version valuepublic boolean isAboveRange(Version ver)
ver
- Version to be checkedpublic boolean isAboveRange(java.lang.String ver) throws InvalidVersionFormatException
ver
- String to be checkedInvalidVersionFormatException
public boolean isBellowRange(Version ver)
ver
- Version to be checkedpublic boolean isBelowRange(java.lang.String ver) throws InvalidVersionFormatException
ver
- String to be checkedInvalidVersionFormatException
public boolean isOverlap(VersionRange otherRange)
public java.lang.String toString()
toString
in class java.lang.Object