Constructor and Description |
---|
Version(int major,
int minor,
int patch)
Create a new instance.
|
Version(int major,
int minor,
int patch,
boolean snapshot,
java.util.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(java.lang.Object obj) |
java.util.Date |
getBuildDate()
Get the build date and time if one was provided.
|
static java.lang.String |
getCurrentFullBuildMessage() |
static java.lang.String |
getCurrentVersionAndBuildDate() |
static java.lang.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(java.lang.Object... args) |
java.lang.String |
toString() |
static Version |
versionFor(java.lang.String version,
java.lang.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, java.util.Date buildDate)
major
- minor
- patch
- snapshot
- buildDate
- public int getMajor()
public int getMinor()
public int getPatch()
public boolean isSnapshot()
public java.util.Date getBuildDate()
public int compareTo(Version o)
compareTo
in interface java.lang.Comparable<Version>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static Version current()
public static Version versionFor(java.lang.String version, java.lang.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 java.lang.String getCurrentVersionText()
public static java.lang.String getCurrentVersionAndBuildDate()
public static java.lang.String getCurrentFullBuildMessage()
public static void main(java.lang.Object... args)