Enum Class ProtocolVersion

java.lang.Object
java.lang.Enum<ProtocolVersion>
org.apache.cassandra.transport.ProtocolVersion
All Implemented Interfaces:
Serializable, Comparable<ProtocolVersion>, Constable

public enum ProtocolVersion extends Enum<ProtocolVersion> implements 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.
  • Enum Constant Details

  • Field Details

    • SUPPORTED

      public static final EnumSet<ProtocolVersion> SUPPORTED
      All supported versions, published as an enumset
    • UNSUPPORTED

      public static final 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 Optional<ProtocolVersion> BETA
  • Method Details

    • values

      public static ProtocolVersion[] 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

      public static ProtocolVersion valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • supportedVersions

      public static List<String> supportedVersions()
    • supportedVersionsStartingWith

      public static List<ProtocolVersion> supportedVersionsStartingWith(ProtocolVersion smallestVersion)
    • decode

      public static ProtocolVersion decode(int versionNum, boolean allowOlderProtocols)
    • isBeta

      public boolean isBeta()
    • invalidVersionMessage

      public static String invalidVersionMessage(int version)
    • asInt

      public int asInt()
    • toString

      public String toString()
      Overrides:
      toString in class 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)