Package org.apache.cassandra.transport
Enum ProtocolVersion
- java.lang.Object
-
- java.lang.Enum<ProtocolVersion>
-
- org.apache.cassandra.transport.ProtocolVersion
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ProtocolVersion>
public enum ProtocolVersion extends java.lang.Enum<ProtocolVersion> implements java.lang.Comparable<ProtocolVersion>
The native (CQL binary) protocol version. Some versions may be in beta, which means that the client must specify the beta flag in the envelope's header for the version to be considered valid. Beta versions must have the word "beta" in their description, this is mandated by the specs.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Optional<ProtocolVersion>
BETA
static ProtocolVersion
CURRENT
The preferred version.static java.util.EnumSet<ProtocolVersion>
SUPPORTED
All supported versions, published as an enumsetstatic java.util.EnumSet<ProtocolVersion>
UNSUPPORTED
Old unsupported versions, this is OK as long as we never add newer unsupported versions
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
asInt()
static ProtocolVersion
decode(int versionNum, boolean allowOlderProtocols)
static java.lang.String
invalidVersionMessage(int version)
boolean
isBeta()
boolean
isGreaterOrEqualTo(ProtocolVersion other)
boolean
isGreaterThan(ProtocolVersion other)
boolean
isSmallerOrEqualTo(ProtocolVersion other)
boolean
isSmallerThan(ProtocolVersion other)
static java.util.List<java.lang.String>
supportedVersions()
static java.util.List<ProtocolVersion>
supportedVersionsStartingWith(ProtocolVersion smallestVersion)
java.lang.String
toString()
static ProtocolVersion
valueOf(java.lang.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
-
SUPPORTED
public static final java.util.EnumSet<ProtocolVersion> SUPPORTED
All supported versions, published as an enumset
-
UNSUPPORTED
public static final java.util.EnumSet<ProtocolVersion> UNSUPPORTED
Old unsupported versions, this is OK as long as we never add newer unsupported versions
-
CURRENT
public static final ProtocolVersion CURRENT
The preferred version. When updating this remember to also update the MULTI_UPGRADES in cassandra-dtest/upgrade_tests/upgrade_through_versions_test.py
-
BETA
public static final java.util.Optional<ProtocolVersion> BETA
-
-
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(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
supportedVersions
public static java.util.List<java.lang.String> supportedVersions()
-
supportedVersionsStartingWith
public static java.util.List<ProtocolVersion> supportedVersionsStartingWith(ProtocolVersion smallestVersion)
-
decode
public static ProtocolVersion decode(int versionNum, boolean allowOlderProtocols)
-
isBeta
public boolean isBeta()
-
invalidVersionMessage
public static java.lang.String invalidVersionMessage(int version)
-
asInt
public int asInt()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<ProtocolVersion>
-
isGreaterThan
public final boolean isGreaterThan(ProtocolVersion other)
-
isGreaterOrEqualTo
public final boolean isGreaterOrEqualTo(ProtocolVersion other)
-
isSmallerThan
public final boolean isSmallerThan(ProtocolVersion other)
-
isSmallerOrEqualTo
public final boolean isSmallerOrEqualTo(ProtocolVersion other)
-
-