public class BuildVersion extends Object implements Comparable<BuildVersion>, Serializable
[Major].[Minor].[Patch].[Build]
". Instances of this class are used
to facilitate some neat automated build functionality. They are also used
as a basis for ReleaseVersion
instances.
Instances are immutable, which makes them thread-safe. The equals()
and hashCode()
methods have been overridden so that this class will
play nicely with the Collection framework (e.g. using instances as keys in
maps). This class implements the Comparable
interface so instances
sort correctly.
Modifier and Type | Method and Description |
---|---|
int |
compareTo(BuildVersion bv) |
boolean |
equals(Object o) |
String |
getBuild()
Returns the build component of the build version.
|
int |
getMajor()
Returns the major component of the build version.
|
int |
getMinor()
Returns the minor component of the build version.
|
int |
getPatch()
Returns the patch component of the build version.
|
ReleaseVersion |
getReleaseVersion()
Returns this build version wrapped in a release version.
|
int |
hashCode() |
String |
toShortString() |
String |
toString() |
static BuildVersion |
valueOf(int major,
int minor,
int patch,
String build)
Returns the build version instance that the specified integer
parameters represent.
|
static BuildVersion |
valueOf(String buildVersionStr)
Returns the build version instance that the specified string
represents.
|
public int getMajor()
public int getMinor()
public int getPatch()
public String getBuild()
public String toShortString()
public int compareTo(BuildVersion bv)
compareTo
in interface Comparable<BuildVersion>
public ReleaseVersion getReleaseVersion()
public static BuildVersion valueOf(String buildVersionStr)
"M.mm.pp.bbb"
where
BuildVersion bv = BuildVersion.valueOf("5.50.2.79c");
buildVersionStr
- the version string in "M.mm.pp.bbb"
formNullPointerException
- if the parameter is nullIllegalArgumentException
- if the parameter is ill-formedpublic static BuildVersion valueOf(int major, int minor, int patch, String build)
major
- the major numberminor
- the minor numberpatch
- the patch numberbuild
- the build numberIllegalArgumentException
- if bad parameters are passed inCopyright © 2015. All Rights Reserved.