public enum ServerVersion extends java.lang.Enum<ServerVersion> implements Version
Enum Constant and Description |
---|
INVALID |
v10 |
v11 |
v12 |
v8_2 |
v8_3 |
v8_4 |
v9_0 |
v9_1 |
v9_2 |
v9_3 |
v9_4 |
v9_5 |
v9_6 |
Modifier and Type | Field and Description |
---|---|
private int |
version |
Modifier and Type | Method and Description |
---|---|
static Version |
from(java.lang.String version)
Attempt to parse the server version string into an XXYYZZ form version number into a
Version . |
int |
getVersionNum()
Get a machine-readable version number.
|
(package private) static int |
parseServerVersionStr(java.lang.String serverVersion)
Attempt to parse the server version string into an XXYYZZ form version number.
|
static ServerVersion |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ServerVersion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ServerVersion INVALID
public static final ServerVersion v8_2
public static final ServerVersion v8_3
public static final ServerVersion v8_4
public static final ServerVersion v9_0
public static final ServerVersion v9_1
public static final ServerVersion v9_2
public static final ServerVersion v9_3
public static final ServerVersion v9_4
public static final ServerVersion v9_5
public static final ServerVersion v9_6
public static final ServerVersion v10
public static final ServerVersion v11
public static final ServerVersion v12
public static ServerVersion[] values()
for (ServerVersion c : ServerVersion.values()) System.out.println(c);
public static ServerVersion valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int getVersionNum()
getVersionNum
in interface Version
public static Version from(java.lang.String version)
Attempt to parse the server version string into an XXYYZZ form version number into a
Version
.
If the specified version cannot be parsed, the Version.getVersionNum()
will return 0.
version
- version in numeric XXYYZZ form, e.g. "090401" for 9.4.1Version
representing the specified version string.static int parseServerVersionStr(java.lang.String serverVersion) throws java.lang.NumberFormatException
Attempt to parse the server version string into an XXYYZZ form version number.
Returns 0 if the version could not be parsed.
Returns minor version 0 if the minor version could not be determined, e.g. devel or beta releases.
If a single major part like 90400 is passed, it's assumed to be a pre-parsed version and returned verbatim. (Anything equal to or greater than 10000 is presumed to be this form).
The yy or zz version parts may be larger than 99. A NumberFormatException is thrown if a version part is out of range.
serverVersion
- server vertion in a XXYYZZ formjava.lang.NumberFormatException