Simple class to handler tri-part version numbers including a stage tag, like 2.6.1-RC1. All parts are expected to be numeric, except the stage, which can be an arbitrary string.
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
SNAPSHOT |
| Constructor and description |
|---|
RaptorVersion
(java.lang.String versionString)Construct from the given version string. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.String |
asSnapshot()Return the version with any existing stage replaced with 'SNAPSHOT'. |
|
void |
bumpMinor()Increment the minor component number. |
|
void |
bumpPatch()Increment the patch component number. |
|
boolean |
equals(java.lang.Object o) |
|
int |
getMajor()@return The major component as an integer |
|
java.lang.String |
getMajorMinor()Get the major and minor components of the version. |
|
int |
getMinor()@return The minor component as an integer |
|
int |
getPatch()@return The patch component as an integer |
|
java.lang.String |
getRootVersion()@return the 'root' version (without the stage), e.g., for '2.6.1-SNAPSHOT' this returns '2.6.1' |
|
java.lang.String |
getStage()
|
|
int |
hashCode() |
|
boolean |
isFinal()@return true if the stage of this version is empty (final) |
|
boolean |
isSnapshot()@return true if the stage of this version is SNAPSHOT |
|
void |
setPatch(int patch)Set the patch component to the give value. |
|
void |
setStage(java.lang.String stage)Set the stage to the given value. |
|
java.lang.String |
toString()@return The full version including the stage, e.g., '2.6.1-RC1' |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Construct from the given version string. The string must be of the form 'X.Y.Z' or 'X.Y.Z-STAGE'. If X, Y, and Z are not each convertible to an integer, then an exception will be thrown.
versionString - The string to parse, e.g., '2.6.1-RC1'Return the version with any existing stage replaced with 'SNAPSHOT'. For example, if this version is 2.6.1-RC1, then this method would return '2.6.1-SNAPSHOT'.
Increment the minor component number.
Increment the patch component number.
Get the major and minor components of the version. For example, if the full version is 2.6.1-RC1, then this method returns '2.6'.
true if the stage of this version is empty (final)
true if the stage of this version is SNAPSHOTSet the patch component to the give value.
patch - New patch valueSet the stage to the given value.
stage - New stage value
Groovy Documentation