public class Version extends Object implements Comparable<Version>
Constructor and Description |
---|
Version(int major,
int minor,
int patch)
Create a new instance.
|
Version(int major,
int minor,
int patch,
boolean snapshot,
Date buildDate)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version o) |
static Version |
current()
Get the current version of this build.
|
boolean |
equals(Object obj) |
Date |
getBuildDate()
Get the build date and time if one was provided.
|
static String |
getCurrentFullBuildMessage() |
static String |
getCurrentVersionAndBuildDate() |
static String |
getCurrentVersionText() |
int |
getMajor()
Get the major version.
|
int |
getMinor()
Get the minor version.
|
int |
getPatch()
Get the patch version.
|
int |
hashCode() |
boolean |
isSnapshot()
Is this build version representing a snapshot version.
|
static void |
main(Object... args) |
String |
toString() |
static Version |
versionFor(String version,
String date)
Create a version for the given version text and date text.
|
public Version(int major, int minor, int patch)
major
- minor
- patch
- public Version(int major, int minor, int patch, boolean snapshot, Date buildDate)
major
- minor
- patch
- snapshot
- buildDate
- public int getMajor()
public int getMinor()
public int getPatch()
public boolean isSnapshot()
public Date getBuildDate()
public int compareTo(Version o)
compareTo
in interface Comparable<Version>
public static Version current()
public static Version versionFor(String version, String date)
The version is expected to be in the form major.minor.patch
or major.minor.patch-SNAPSHOT
. If the version is not
in this form null will be returned.
The date is expected to be one of the standard date time formats
as specified in ArooaConstants
. If it is not in this format
a version with a null date property will be returned.
version
- The version as text. Must not be null.date
- The date as text. May be null.public static String getCurrentVersionText()
public static String getCurrentVersionAndBuildDate()
public static String getCurrentFullBuildMessage()
public static void main(Object... args)