Package org.apache.cassandra.transport
Enum Class ProtocolVersion
- All Implemented Interfaces:
Serializable,Comparable<ProtocolVersion>,Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Optional<ProtocolVersion>static final ProtocolVersionThe preferred version.static final EnumSet<ProtocolVersion>All supported versions, published as an enumsetstatic final EnumSet<ProtocolVersion>Old unsupported versions, this is OK as long as we never add newer unsupported versions -
Method Summary
Modifier and TypeMethodDescriptionintasInt()static ProtocolVersiondecode(int versionNum, boolean allowOlderProtocols) static StringinvalidVersionMessage(int version) booleanisBeta()final booleanfinal booleanisGreaterThan(ProtocolVersion other) final booleanfinal booleanisSmallerThan(ProtocolVersion other) static List<ProtocolVersion>supportedVersionsStartingWith(ProtocolVersion smallestVersion) toString()static ProtocolVersionReturns the enum constant of this class with the specified name.static ProtocolVersion[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOfMethods inherited from interface java.lang.Comparable
compareTo
-
Enum Constant Details
-
V1
-
V2
-
V3
-
V4
-
V5
-
V6
-
-
Field Details
-
SUPPORTED
All supported versions, published as an enumset -
UNSUPPORTED
Old unsupported versions, this is OK as long as we never add newer unsupported versions -
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
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
supportedVersions
-
supportedVersionsStartingWith
-
decode
-
isBeta
public boolean isBeta() -
invalidVersionMessage
-
asInt
public int asInt() -
toString
- Overrides:
toStringin classEnum<ProtocolVersion>
-
isGreaterThan
-
isGreaterOrEqualTo
-
isSmallerThan
-
isSmallerOrEqualTo
-