@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=false, mayInvoke=true) public final class BuildVersion extends Object implements Comparable<BuildVersion>
| Modifier and Type | Method and Description |
|---|---|
static BuildVersion |
binaryVersion()
Returns the build version as specified by the dynamic constants.
|
static void |
checkVersionMismatch()
Checks if the binary version is the same than the instance version.
|
int |
compareTo(BuildVersion version) |
boolean |
equals(Object obj) |
int |
getMajorVersion()
Returns the major release version number.
|
int |
getMinorVersion()
Returns the minor release version number.
|
int |
getPointVersion()
Returns the point release version number.
|
String |
getRevision()
Returns the VCS revision.
|
int |
hashCode() |
static BuildVersion |
instanceVersion()
Reads the instance version from config/buildinfo.
|
boolean |
isNewerThan(BuildVersion version)
Returns
true if the version is newer than the provided version. |
boolean |
isOlderThan(BuildVersion version)
Returns
true if the version is older than the provided version. |
String |
toString() |
String |
toStringNoRevision()
Returns a string representation of the BuildVersion including the major, minor and point
versions, but excluding the revision number.
|
static BuildVersion |
valueOf(String s)
Parses the string argument as a build version.
|
public static BuildVersion binaryVersion()
public static BuildVersion instanceVersion() throws InitializationException
InitializationException - If an error occurred while reading or parsing the version.public static void checkVersionMismatch()
throws InitializationException
InitializationException - Sends an exception if the version mismatch.public static BuildVersion valueOf(String s) throws IllegalArgumentException
major.minor.point[.rev]
s - The string to be parsed as a build version.IllegalArgumentException - If the string does not contain a parsable build version.public int compareTo(BuildVersion version)
compareTo in interface Comparable<BuildVersion>public int getMajorVersion()
public int getMinorVersion()
public int getPointVersion()
public String getRevision()
public String toStringNoRevision()
public boolean isNewerThan(BuildVersion version)
true if the version is newer than the provided version.version - The version to be comparedtrue if the version is newer than the provided version.public boolean isOlderThan(BuildVersion version)
true if the version is older than the provided version.version - The version to be comparedtrue if the version is older than the provided version.Copyright © 2010-2020 Wren Security. All Rights Reserved.