public class Version extends Object implements Comparable
| Modifier and Type | Field and Description |
|---|---|
static String |
NOT_AVAILABLE
The Constant NOT_AVAILABLE.
|
| Constructor and Description |
|---|
Version()
Constructor.
|
Version(int nMajor,
int nMinor,
int nPatch,
String strQualifier)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object object)
Compare to.
|
int |
getMajor()
Gets the major.
|
int |
getMinor()
Gets the minor.
|
static List<String> |
getNextReleaseVersions(String strPreviousReleaseVersion)
Get a list of next versions for a given version.
|
static String |
getNextSnapshotVersion(String strVersion)
Get the next snapshot version for a given version.
|
int |
getPatch()
Gets the patch.
|
String |
getQualifier()
Gets the qualifier.
|
static String |
getReleaseVersion(String strVersion)
Get the next release version for a given version.
|
String |
getVersion()
Gets the version.
|
boolean |
isCandidate()
Returns true if the version is qualified as Candidate.
|
static boolean |
isCandidate(String strVersion)
Check if a given version is a RELEASE CANDIDATE.
|
boolean |
isSnapshot()
Returns true if the version is qualified as Snapshot.
|
static boolean |
isSnapshot(String strVersion)
Check if a given version is a SNAPSHOT.
|
Version |
nextMajor(boolean bSnapshot)
Build a new version object with major digit incremented.
|
Version |
nextMinor(boolean bSnapshot)
Build a new version object with minor digit incremented.
|
Version |
nextPatch(boolean bSnapshot)
Build a new version object with patch digit incremented.
|
Version |
nextRelease()
Build a new version object with no qualifier.
|
static Version |
parse(String strSource)
Parse a string to extract version.
|
void |
setMajor(int nMajor)
Sets the major.
|
void |
setMinor(int nMinor)
Sets the minor.
|
void |
setPatch(int nPatch)
Sets the patch.
|
void |
setQualifier(String strQualifier)
Sets the qualifier.
|
Version |
snapshot()
returns the snapshot version.
|
String |
toString()
.
|
public static final String NOT_AVAILABLE
public Version()
public Version(int nMajor,
int nMinor,
int nPatch,
String strQualifier)
nMajor - major digitnMinor - minor digitnPatch - patch digitstrQualifier - qualifierpublic int getMajor()
public void setMajor(int nMajor)
nMajor - the nMajor to setpublic int getMinor()
public void setMinor(int nMinor)
nMinor - the nMinor to setpublic int getPatch()
public void setPatch(int nPatch)
nPatch - the nPatch to setpublic String getQualifier()
public void setQualifier(String strQualifier)
strQualifier - the Qualifier to setpublic int compareTo(Object object)
compareTo in interface Comparableobject - the objectpublic String getVersion()
public static Version parse(String strSource) throws VersionParsingException
strSource - The sourceVersionParsingException - if parsing failedpublic Version snapshot()
public Version nextMajor(boolean bSnapshot)
bSnapshot - if snapshot qualifier neededpublic Version nextMinor(boolean bSnapshot)
bSnapshot - if snapshot qualifier neededpublic Version nextPatch(boolean bSnapshot)
bSnapshot - if snapshot qualifier neededpublic Version nextRelease()
public boolean isSnapshot()
public boolean isCandidate()
public static boolean isSnapshot(String strVersion)
strVersion - The version to checkpublic static boolean isCandidate(String strVersion)
strVersion - The version to checkpublic static List<String> getNextReleaseVersions(String strPreviousReleaseVersion)
strPreviousReleaseVersion - The current versionpublic static String getNextSnapshotVersion(String strVersion)
strVersion - The current versionCopyright © 2022 City of Paris. All rights reserved.