public class Version extends Object implements Serializable, Comparable<Version>
Modifier and Type | Field and Description |
---|---|
static Version |
UNKNOWN
A version to use when we don't know the version.
|
static Version |
VERSION
The driver's version.
|
static Version |
VERSION_0
The "zero" version which should be before all other versions.
|
static Version |
VERSION_2_0
Version 2.0
|
static Version |
VERSION_2_2
Version 2.2
|
static Version |
VERSION_2_4
Version 2.4
|
protected static Version |
VERSION_2_5_2
Version 2.5.2 - Wire Protocol version = 1.
|
protected static Version |
VERSION_2_5_4
Version 2.5.4 - Wire Protocol version = 2.
|
static Version |
VERSION_2_6
Version 2.6
|
Modifier and Type | Method and Description |
---|---|
protected int |
compare(int x,
int y)
Compares two
int values numerically. |
int |
compareTo(Version other) |
static Version |
earlier(Version lhs,
Version rhs)
Returns the earlier of the two versions.
|
boolean |
equals(Object object)
Determines if the passed object is of this same type as this object and
if so that its fields are equal.
|
static Version |
forWireVersion(int wireVersion)
Returns the best guess at the version of the server based on the wire
protocol version number.
|
int |
hashCode()
Computes a reasonable hash code.
|
static Version |
later(Version lhs,
Version rhs)
Returns the later of the two versions.
|
static Version |
parse(List<NumericElement> versionArray)
Parses a version from a version array.
|
static Version |
parse(String version)
Parses a version of the general format 'int.int.int-suffix'.
|
String |
toString() |
public static final Version UNKNOWN
public static final Version VERSION
public static final Version VERSION_0
public static final Version VERSION_2_0
public static final Version VERSION_2_2
public static final Version VERSION_2_4
public static final Version VERSION_2_6
protected static final Version VERSION_2_5_2
protected static final Version VERSION_2_5_4
public static Version earlier(Version lhs, Version rhs)
null
then the other version is returned. Only if both version are
null
will null
be returned.lhs
- The first version to compare.rhs
- The second version to compare.public static Version forWireVersion(int wireVersion)
wireVersion
- Wire protocol version.null
if the version
cannot be determined.public static Version later(Version lhs, Version rhs)
null
then the other version is returned. Only if both version are null
will null
be returned.lhs
- The first version to compare.rhs
- The second version to compare.public static Version parse(List<NumericElement> versionArray)
NumericElement
s.versionArray
- The version array to parse.public static Version parse(String version)
version
- The version string to parse.public int compareTo(Version other)
Overridden to compare the two versions.
compareTo
in interface Comparable<Version>
public boolean equals(Object object)
equals
in class Object
object
- The object to compare to.Object.equals(java.lang.Object)
public int hashCode()
public String toString()
Overridden to produce a human readable string for the version.
protected int compare(int x, int y)
int
values numerically. The value returned is
identical to what would be returned by:
Integer.valueOf(x).compareTo(Integer.valueOf(y))
x
- the first int
to comparey
- the second int
to compare0
if x == y
; a value less than
0
if x < y
; and a value greater than 0
if
x > y
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.