Class VersionRange
java.lang.Object
net.adoptopenjdk.icedteaweb.jnlp.version.VersionRange
A version-range is either a version-id, a version-id followed by a star (*),
a version-id followed by a plus sign (+) , or two version-ranges combined using an ampersand (&).
The star means prefix match, the plus sign means this version or greater,
and the ampersand means the logical and-ing of the two version-ranges.
The syntax of version-strings is:
version-string ::= version-range ( " " element) *
version-range ::= simple-range ( "&" simple-range) *
simple-range ::= version-id | version-id modifier
modifier ::= "+" | "*"
See JSR-56 Specification, Appendix A.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if this version-range contains the givenversionId.booleanCheck if this version-range contains the givenversionId.booleanstatic VersionRangefromString(String versionRange) Construct a version-range by the givenversionRange.(package private) VersionId(package private) booleanChecks whether this version-range represents a range with a greater or equal modifier.(package private) booleanChecks whether this version-range represents a range with a prefix match modifier.(package private) boolean(package private) booleanisEqualTo(VersionRange otherVersionRange) (package private) booleanChecks whether this version-range represents a plain (exact) version without any postfix modifiers.toString()Provides a string representation of thisVersionRange.
-
Field Details
-
simpleRanges
-
-
Constructor Details
-
VersionRange
-
-
Method Details
-
isCompoundVersion
boolean isCompoundVersion()- Returns:
trueif this version-range is a compound range using an ampersand (&), false otherwise
-
isExactVersion
boolean isExactVersion()Checks whether this version-range represents a plain (exact) version without any postfix modifiers.- Returns:
trueif this version-range does not have any modifiers,falseotherwise.
-
getExactVersion
VersionId getExactVersion()- Returns:
- the exact version if this version-range is one
- Throws:
IllegalStateException- if this version-range is not one
-
hasPrefixMatchModifier
boolean hasPrefixMatchModifier()Checks whether this version-range represents a range with a prefix match modifier.- Returns:
trueif this version-range is not a compound range and its only simple range has a prefix match modifier,falseotherwise.
-
hasGreaterThanOrEqualMatchModifier
boolean hasGreaterThanOrEqualMatchModifier()Checks whether this version-range represents a range with a greater or equal modifier.- Returns:
trueif this version-range is not a compound range and its only simple range has a greater or equal modifier,falseotherwise.
-
fromString
Construct a version-range by the givenversionRange.- Parameters:
versionRange- a version-range- Returns:
- a version-id
-
contains
Check if this version-range contains the givenversionId.- Parameters:
versionId- a version-id- Returns:
trueif this version-range containsversionId,falseotherwise.
-
contains
Check if this version-range contains the givenversionId.- Parameters:
versionId- a version-id- Returns:
trueif this version-range containsversionId,falseotherwise.
-
isEqualTo
-
equals
-
toString
Provides a string representation of thisVersionRange.
-