public abstract class VersionSpecification extends java.lang.Object implements java.lang.Comparable<VersionSpecification>, java.io.Serializable
The most important thing for a version specification is that it can be compared to another one.
Versions can be specified in two formats : a simple 3-digit spec (+ qualifiers) or a code/tag (not yet ;-) ).
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_versionString
The version string.
|
Constructor and Description |
---|
VersionSpecification() |
Modifier and Type | Method and Description |
---|---|
static VersionSpecification |
parse(java.lang.String version)
Parses the given version String, using '.' , '-' , '_' as potential delimiters.
|
public static VersionSpecification parse(java.lang.String version)
For 3-digit version spec, currently the only supported format, the first 3 version ids are mandatory and should be integer numbers. Extra (optional) trailing ids can be textual. Spaces are not allowed in a version string. E.g. "1.2_3-hello.world" is a valid version identifier.
version
- The versionjava.lang.IllegalArgumentException
- when the overall string format is not validjava.lang.NumberFormatException
- if one of the first 3 segments is not an integer