public class IstiVersion
extends java.lang.Object
implements java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BETA_STRING
Beta string.
|
static java.lang.String |
DIVIDER
Divider string for version numbers.
|
Constructor and Description |
---|
IstiVersion(int... args)
Creates a version that isn't a beta version.
|
IstiVersion(int[] args,
boolean beta)
Creates a version.
|
IstiVersion(int major,
int minor,
int patch,
int build,
boolean beta)
Creates a version.
|
IstiVersion(java.lang.String complete)
Creates a version.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(IstiVersion o)
Compares this IstiVersion with the specified IstiVersion.
|
int |
compareTo(java.lang.Object o)
Compares this IstiVersion with the specified IstiVersion.
|
boolean |
equals(IstiVersion o)
Compares this IstiVersion to the specified object.
|
boolean |
equals(java.lang.Object o)
Compares this IstiVersion to the specified object.
|
int |
getBuild()
Gets the build.
|
(package private) int |
getMajor()
Get the major version.
|
int |
getMinor()
Gets the minor version.
|
int |
getPatch()
Gets the patch version.
|
boolean |
isBeta()
Determines if this is a beta version.
|
protected static boolean |
isBeta(java.lang.String complete)
Determines if the complete version string contains beta.
|
java.lang.String |
toString()
Returns a string representation of this version.
|
static java.lang.String |
toString(int[] version,
boolean beta)
Return a string representation of the version.
|
public static final java.lang.String BETA_STRING
public static final java.lang.String DIVIDER
public IstiVersion(java.lang.String complete)
complete
- the complete version string.public IstiVersion(int major, int minor, int patch, int build, boolean beta)
major
- the major version.minor
- the minor version.patch
- the patch version.build
- the build version.beta
- true if beta, false otherwise.public IstiVersion(int... args)
args
- an array of versions.public IstiVersion(int[] args, boolean beta)
args
- an array of versions.beta
- true if beta, false otherwise.public static java.lang.String toString(int[] version, boolean beta)
version
- the version.beta
- true if beta, false otherwise.protected static boolean isBeta(java.lang.String complete)
complete
- the complete version string.public int compareTo(java.lang.Object o)
compareTo(IstiVersion)
. Otherwise, it throws a
ClassCastException
(as Versions are comparable
only to other Versions).compareTo
in interface java.lang.Comparable
o
- the Object
to be compared.0
if the versions are equal;
a value less than 0
if this version
is less than the specified version;
and a value greater than 0
if this version
is greater than the specified version.ClassCastException
- if the argument is not a
IstiVersion
.public int compareTo(IstiVersion o)
o
- the Object
to be compared.0
if the versions are equal;
a value less than 0
if this version
is less than the specified version;
and a value greater than 0
if this version
is greater than the specified version.public boolean equals(java.lang.Object o)
true
if and only if the argument is not
null
and is a IstiVersion
object that represents
the same version as this object.equals
in class java.lang.Object
o
- the Object
to be compared.true
if the IstiVersion
are equal;
false
otherwise.public boolean equals(IstiVersion o)
true
if and only if the argument is not
null
and is a IstiVersion
object that represents
the same version as this object.o
- the Object
to be compared.true
if the IstiVersion
are equal;
false
otherwise.public int getBuild()
int getMajor()
public int getMinor()
public int getPatch()
public boolean isBeta()
public java.lang.String toString()
toString
in class java.lang.Object