Class VersionString
java.lang.Object
net.adoptopenjdk.icedteaweb.jnlp.version.VersionString
A version-string is a list of version-ranges separated by spaces. 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 ( " " version-range) *
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this version-string (list of exact version-ids or version ranges) contains the givenversionId.booleanChecks if this version-string (list of exact version-ids or version ranges) contains the givenversionId.booleanbooleanstatic VersionStringfromString(String versionString) Construct a version-string by the givenversionString.booleantoString()Provides string representation of this version-string.
-
Field Details
-
ANY_VERSION
-
-
Method Details
-
fromString
Construct a version-string by the givenversionString.- Parameters:
versionString- a version-string- Returns:
- a versionString
-
containsSingleVersionRange
public boolean containsSingleVersionRange()- Returns:
trueif this version-string consists of only a single version-range,falseotherwise.
-
isExactVersion
public boolean isExactVersion()- Returns:
trueif this version-string consists of a single version-range which is an exact match,falseotherwise.
-
getExactVersion
- Returns:
- the exact version if this version-string is one
- Throws:
IllegalStateException- if this version-string is not none
-
contains
Checks if this version-string (list of exact version-ids or version ranges) contains the givenversionId.- Parameters:
versionId- a version-id- Returns:
trueif this version-string contains the givenversionId,falseotherwise
-
contains
Checks if this version-string (list of exact version-ids or version ranges) contains the givenversionId.- Parameters:
versionId- a version-id- Returns:
trueif this version-string contains the givenversionId,falseotherwise
-
equals
-
toString
Provides string representation of this version-string.
-