Package com.datastax.driver.core
Enum ProtocolVersion
- java.lang.Object
-
- java.lang.Enum<ProtocolVersion>
-
- com.datastax.driver.core.ProtocolVersion
-
- All Implemented Interfaces:
Serializable,Comparable<ProtocolVersion>
public enum ProtocolVersion extends Enum<ProtocolVersion>
Versions of the native protocol supported by the driver.
-
-
Field Summary
Fields Modifier and Type Field Description static ProtocolVersionDEFAULTThe default protocol version used by the driver to connect to the cluster if no specific protocol version was set.static ProtocolVersionNEWEST_BETAThe most recent beta protocol version supported by the driver.static ProtocolVersionNEWEST_SUPPORTEDThe most recent protocol version supported by the driver.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProtocolVersionfromInt(int i)Returns the value matching an integer version.ProtocolVersiongetLowerSupported()Returns the highest supported version that is lower than this version.booleanisShardingSupported()inttoInt()Returns the version as an integer.static ProtocolVersionvalueOf(String name)Returns the enum constant of this type with the specified name.static ProtocolVersion[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
V1
public static final ProtocolVersion V1
-
V2
public static final ProtocolVersion V2
-
V3
public static final ProtocolVersion V3
-
V4
public static final ProtocolVersion V4
-
V5
public static final ProtocolVersion V5
-
V6
public static final ProtocolVersion V6
-
-
Field Detail
-
NEWEST_SUPPORTED
public static final ProtocolVersion NEWEST_SUPPORTED
The most recent protocol version supported by the driver.
-
NEWEST_BETA
public static final ProtocolVersion NEWEST_BETA
The most recent beta protocol version supported by the driver.
-
DEFAULT
public static final ProtocolVersion DEFAULT
The default protocol version used by the driver to connect to the cluster if no specific protocol version was set.
-
-
Method Detail
-
values
public static ProtocolVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ProtocolVersion c : ProtocolVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ProtocolVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
toInt
public int toInt()
Returns the version as an integer.- Returns:
- the integer representation.
-
isShardingSupported
public boolean isShardingSupported()
-
getLowerSupported
public ProtocolVersion getLowerSupported()
Returns the highest supported version that is lower than this version. Returnsnullif there isn't such a version.- Returns:
- the highest supported version that is lower than this version.
-
fromInt
public static ProtocolVersion fromInt(int i)
Returns the value matching an integer version.- Parameters:
i- the version as an integer.- Returns:
- the matching enum value.
- Throws:
IllegalArgumentException- if the argument doesn't match any known version.
-
-