ProtocolVersion (apache-cassandra API)
Date: 2018-02-14

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 frame 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 Summary

    Enum Constants
    Enum Constant and Description
    `V1`
    `V2`
    `V3`
    `V4`
    `V5`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.util.Optional<ProtocolVersion>` | `BETA`
    `static ProtocolVersion` | `CURRENT` The preferred versions
    `static java.util.EnumSet<ProtocolVersion>` | `SUPPORTED` All supported versions, published as an enumset
    `static 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 and Description
    --- | ---
    `int` | `asInt()`
    `static ProtocolVersion` | `decode(int versionNum)`
    `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()`
    `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.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### 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

  - ### 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 versions

    - #### 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 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)

    - #### 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)

Copyright © 2018 The Apache Software Foundation