Enum 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 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
    • 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 name
        java.lang.NullPointerException - if the argument is null
      • supportedVersions

        public static java.util.List<java.lang.String> supportedVersions()
      • 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 class java.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)