com.h3c.of.lib.msg

## Enum MeterBandType

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

- All Implemented Interfaces:
    OfpCodeBasedEnum, OfpEnum, Serializable, Comparable<MeterBandType>

      public enum MeterBandType
      extends Enum<MeterBandType>
      implements OfpCodeBasedEnum

  Designates meter band types; Since 1.3.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `DROP` Drop packet; Since 1.3.
    `DSCP_REMARK` Remark DSCP in the IP header; Since 1.3.
    `EXPERIMENTER` Experimenter meter band; Since 1.3.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Set<MeterBandType>` | `decodeFlags(int bitmap, ProtocolVersion pv)` Decodes the meter band type flags, based on the code associated with the flags, and returns the set of corresponding constants.
    `static int` | `encodeFlags(Set<MeterBandType> flags, ProtocolVersion pv)` Encodes a set of meter band type flags as a bitmap.
    `int` | `getCode(ProtocolVersion pv)` Returns the internal code for the given band type.
    `static MeterBandType` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static MeterBandType[]` | `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

    - #### DROP

          public static final MeterBandType DROP

      Drop packet; Since 1.3.

    - #### DSCP_REMARK

          public static final MeterBandType DSCP_REMARK

      Remark DSCP in the IP header; Since 1.3.

    - #### EXPERIMENTER

          public static final MeterBandType EXPERIMENTER

      Experimenter meter band; Since 1.3.

  - ### Method Detail

    - #### values

          public static MeterBandType[] 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 (MeterBandType c : MeterBandType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static MeterBandType 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

    - #### getCode

          public int getCode(ProtocolVersion pv)

      Returns the internal code for the given band type.
      Specified by:
        `getCode` in interface `OfpCodeBasedEnum`
      Parameters:
        `pv` - the protocol version
      Returns:
        the internal code

    - #### decodeFlags

          public static Set<MeterBandType> decodeFlags(int bitmap,
                                       ProtocolVersion pv)

      Decodes the meter band type flags, based on the code associated with the flags, and returns the set of corresponding constants.

      Note that the `EXPERIMENTER` can not be represented as a possible flag in an integer bit mask.

      Parameters:
        `bitmap` - the bitmap to decode
        `pv` - the protocol version
      Returns:
        the set of flags
      Throws:
        `NullPointerException` - if protocol version is null
        `VersionMismatchException` - if a bit position is not supported in the given version

    - #### encodeFlags

          public static int encodeFlags(Set<MeterBandType> flags,
                        ProtocolVersion pv)

      Encodes a set of meter band type flags as a bitmap. The `flags` parameter may be empty, in which case a bitmap of 0 (zero) is returned.

      Note that the `EXPERIMENTER` can not be represented as a possible flag in an integer bit mask.

      Parameters:
        `flags` - the flags to encode
        `pv` - the protocol version
      Returns:
        the flags encoded as a bitmap
      Throws:
        `NullPointerException` - if either parameter is null
        `IllegalArgumentException` - if code associated with enumeration constant is outside the valid range (0 - 31)
        `VersionMismatchException` - if a flag is present that is not supported in the given protocol version

Copyright © 2014. All Rights Reserved.