com.h3c.of.lib

## Enum ProtocolVersion

- java.lang.Object
- - java.lang.Enum<ProtocolVersion>
  - - com.h3c.of.lib.ProtocolVersion

- All Implemented Interfaces:
    Serializable, Comparable<ProtocolVersion>

      public enum ProtocolVersion
      extends Enum<ProtocolVersion>

  Denotes the published OpenFlow Protocol versions.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `V_1_0` Version 1.0.0 (December 31, 2009)
    `V_1_1` Version 1.1.0 (February 28, 2011)
    `V_1_2` Version 1.2 (December 5, 2011)
    `V_1_3` Version 1.3.0 (June 25, 2012); Version 1.3.1 (September 6, 2012)

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte` | `code()` Returns the encoded byte value for this protocol version.
    `static ProtocolVersion` | `decode(byte v)` Decodes the version byte value and returns the version constant associated with that value.
    `static ProtocolVersion` | `fromString(String s)` Returns the constant that has the "friendly" text representation specified, or null if no match is found.
    `boolean` | `ge(ProtocolVersion v)` Returns true if this protocol version is later than (greater than) or equal to the specified version.
    `boolean` | `gt(ProtocolVersion v)` Returns true if this protocol version is later than (greater than) the specified version.
    `static ProtocolVersion` | `latest()` Returns the latest protocol version; currently `V_1_3`.
    `boolean` | `le(ProtocolVersion v)` Returns true if this protocol version is earlier than (less than) or equal to the specified version.
    `boolean` | `lt(ProtocolVersion v)` Returns true if this protocol version is earlier than (less than) the specified version.
    `static ProtocolVersion` | `max(Set<ProtocolVersion> versions)` Returns the highest protocol version from the given set.
    `String` | `toDisplayString()` Returns a "friendly" text representation of the protocol version, as stated on the cover page of the related specification.
    `static ProtocolVersion` | `valueOf(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, toString, valueOf`

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

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

- - ### Enum Constant Detail

    - #### V_1_0

          public static final ProtocolVersion V_1_0

      Version 1.0.0 (December 31, 2009)

    - #### V_1_1

          public static final ProtocolVersion V_1_1

      Version 1.1.0 (February 28, 2011)

    - #### V_1_2

          public static final ProtocolVersion V_1_2

      Version 1.2 (December 5, 2011)

    - #### V_1_3

          public static final ProtocolVersion V_1_3

      Version 1.3.0 (June 25, 2012); Version 1.3.1 (September 6, 2012)

  - ### 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(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:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### code

          public byte code()

      Returns the encoded byte value for this protocol version.
      Returns:
        the encoded byte value

    - #### toDisplayString

          public String toDisplayString()

      Returns a "friendly" text representation of the protocol version, as stated on the cover page of the related specification. For example, the `V_1_3` constant will return "1.3.0".
      Returns:
        a friendly text representation of the version

    - #### lt

          public boolean lt(ProtocolVersion v)

      Returns true if this protocol version is earlier than (less than) the specified version.
      Parameters:
        `v` - the version to test against
      Returns:
        true, if this version is earlier than the given version

    - #### le

          public boolean le(ProtocolVersion v)

      Returns true if this protocol version is earlier than (less than) or equal to the specified version.
      Parameters:
        `v` - the version to test against
      Returns:
        true, if this version is earlier than or the same as the given version

    - #### gt

          public boolean gt(ProtocolVersion v)

      Returns true if this protocol version is later than (greater than) the specified version.
      Parameters:
        `v` - the version to test against
      Returns:
        true, if this version is greater than the given version

    - #### ge

          public boolean ge(ProtocolVersion v)

      Returns true if this protocol version is later than (greater than) or equal to the specified version.
      Parameters:
        `v` - the version to test against
      Returns:
        true, if this version is later than or the same as the given version

    - #### latest

          public static ProtocolVersion latest()

      Returns the latest protocol version; currently `V_1_3`.
      Returns:
        the latest protocol version

    - #### decode

          public static ProtocolVersion decode(byte v)
                                        throws DecodeException

      Decodes the version byte value and returns the version constant associated with that value. If the byte value is not recognized, a `DecodeException` will be thrown.
      Parameters:
        `v` - the encoded byte value
      Returns:
        the corresponding version constant
      Throws:
        `DecodeException` - if protocol version cannot be decoded

    - #### fromString

          public static ProtocolVersion fromString(String s)

      Returns the constant that has the "friendly" text representation specified, or null if no match is found.
      Parameters:
        `s` - the string representation
      Returns:
        the corresponding version constant, or null for no match

    - #### max

          public static ProtocolVersion max(Set<ProtocolVersion> versions)

      Returns the highest protocol version from the given set. If the argument is null, or the set is empty, `null` will be returned.
      Parameters:
        `versions` - the set of versions to examine
      Returns:
        the highest version from the set

Copyright © 2014. All Rights Reserved.