Class SemVer
java.lang.Object
org.honton.chas.compose.maven.plugin.SemVer
- All Implemented Interfaces:
Comparable<SemVer>
A semantic version mostly following the rules at semver.org. The
major.minor.patch numbering scheme is loosened. If minor or patch is not supplied, the minor and
patch attributes will be -1.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SemVer
public SemVer()
-
-
Method Details
-
valueOf
Create an instance from the string specification- Parameters:
version- The string- Returns:
- A SemVer; or null, if version is null
- Throws:
IllegalArgumentException- when version is not a semantic version
-
getMajor
public int getMajor()The major version. i.e. X of X.Y.Z -
getMinor
public int getMinor()The minor version. i.e. Y of X.Y.Z -
getPatch
public int getPatch()The patch version. i.e. Z of X.Y.Z -
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<SemVer>
-