Class Version
java.lang.Object
fr.paris.lutece.plugins.releaser.util.version.Version
- All Implemented Interfaces:
Comparable
Version.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompare to.intgetMajor()Gets the major.intgetMinor()Gets the minor.getNextReleaseVersions(String strPreviousReleaseVersion) Get a list of next versions for a given version.getNextReleaseVersions(String strPreviousSnapshotVersion, String strPreviousReleaseVersion) Get a list of next versions for a given version.static StringgetNextSnapshotVersion(String strVersion) Get the next snapshot version for a given version.intgetPatch()Gets the patch.Gets the qualifier.intstatic StringgetReleaseVersion(String strVersion) Get the next release version for a given version.Gets the version.booleanisBeta()Returns true if the version is qualified as Beta.static booleanCheck if a given version is a RELEASE BETA.booleanReturns true if the version is qualified as Candidate.static booleanisCandidate(String strVersion) Check if a given version is a RELEASE CANDIDATE.booleanReturns true if the version is qualified as Snapshot.static booleanisSnapshot(String strVersion) Check if a given version is a SNAPSHOT.nextMajor(boolean bSnapshot) Build a new version object with major digit incremented.nextMinor(boolean bSnapshot) Build a new version object with minor digit incremented.nextPatch(boolean bSnapshot) Build a new version object with patch digit incremented.Build a new version object with no qualifier.static VersionParse a string to extract version.voidsetMajor(int nMajor) Sets the major.voidsetMinor(int nMinor) Sets the minor.voidsetPatch(int nPatch) Sets the patch.voidsetQualifier(String strQualifier) Sets the qualifier.voidsetQualifierNumber(int _nQualifierNumber) voidsetQualifierRadix(String _strQualifierRadix) snapshot()returns the snapshot version.toString().
-
Field Details
-
NOT_AVAILABLE
The Constant NOT_AVAILABLE.- See Also:
-
-
Constructor Details
-
Version
public Version()Constructor. -
Version
Constructor.- Parameters:
nMajor- major digitnMinor- minor digitnPatch- patch digitstrQualifier- qualifier
-
-
Method Details
-
getMajor
public int getMajor()Gets the major.- Returns:
- the nMajor
-
setMajor
public void setMajor(int nMajor) Sets the major.- Parameters:
nMajor- the nMajor to set
-
getMinor
public int getMinor()Gets the minor.- Returns:
- the nMinor
-
setMinor
public void setMinor(int nMinor) Sets the minor.- Parameters:
nMinor- the nMinor to set
-
getPatch
public int getPatch()Gets the patch.- Returns:
- the nPatch
-
setPatch
public void setPatch(int nPatch) Sets the patch.- Parameters:
nPatch- the nPatch to set
-
getQualifier
Gets the qualifier.- Returns:
- the Qualifier
-
setQualifier
Sets the qualifier.- Parameters:
strQualifier- the Qualifier to set
-
getQualifierRadix
-
setQualifierRadix
-
getQualifierNumber
public int getQualifierNumber() -
setQualifierNumber
public void setQualifierNumber(int _nQualifierNumber) -
compareTo
Compare to.- Specified by:
compareToin interfaceComparable- Parameters:
object- the object- Returns:
- the int
-
getVersion
Gets the version.- Returns:
- the version
-
toString
. -
parse
Parse a string to extract version.- Parameters:
strSource- The source- Returns:
- The version object
- Throws:
VersionParsingException- if parsing failed
-
snapshot
returns the snapshot version.- Returns:
- the snapshot version
-
nextMajor
Build a new version object with major digit incremented.- Parameters:
bSnapshot- if snapshot qualifier needed- Returns:
- The next version object
-
nextMinor
Build a new version object with minor digit incremented.- Parameters:
bSnapshot- if snapshot qualifier needed- Returns:
- The next version object
-
nextPatch
Build a new version object with patch digit incremented.- Parameters:
bSnapshot- if snapshot qualifier needed- Returns:
- The next version object
-
nextRelease
Build a new version object with no qualifier.- Returns:
- The next version object
-
isSnapshot
public boolean isSnapshot()Returns true if the version is qualified as Snapshot.- Returns:
- true if the version is qualified as Snapshot
-
isCandidate
public boolean isCandidate()Returns true if the version is qualified as Candidate.- Returns:
- true if the version is qualified as Candidate
-
isBeta
public boolean isBeta()Returns true if the version is qualified as Beta.- Returns:
- true if the version is qualified as Beta
-
isSnapshot
Check if a given version is a SNAPSHOT.- Parameters:
strVersion- The version to check- Returns:
- True if snapshot otherwise false
-
isCandidate
Check if a given version is a RELEASE CANDIDATE.- Parameters:
strVersion- The version to check- Returns:
- True if candidate otherwise false
-
isBeta
Check if a given version is a RELEASE BETA.- Parameters:
strVersion- The version to check- Returns:
- True if beta otherwise false
-
getNextReleaseVersions
public static List<String> getNextReleaseVersions(String strPreviousSnapshotVersion, String strPreviousReleaseVersion) Get a list of next versions for a given version.- Parameters:
strPreviousReleaseVersion- The current version*strPreviousSnapshotVersion- The current Snapshot version- Returns:
- The list
-
getNextReleaseVersions
Get a list of next versions for a given version.- Parameters:
strPreviousReleaseVersion- The current version- Returns:
- The list
-
getNextSnapshotVersion
Get the next snapshot version for a given version.- Parameters:
strVersion- The current version- Returns:
- The version
-
getReleaseVersion
Get the next release version for a given version.- Parameters:
strVersion- The current version- Returns:
- The version
-