com.h3c.of.lib.mp

## Class MBodyMutableMeterConfig

- java.lang.Object
- - com.h3c.of.lib.OpenflowStructure
  - - com.h3c.of.lib.mp.MBodyMeterConfig
    - - com.h3c.of.lib.mp.MBodyMutableMeterConfig

- All Implemented Interfaces:
    MultipartBody, MutableObject, MutableStructure, Structure

      public class MBodyMutableMeterConfig
      extends MBodyMeterConfig
      implements MutableStructure

  Mutable subclass of `MBodyMeterConfig`.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.h3c.of.lib.mp.MBodyMeterConfig

      `MBodyMeterConfig.Array, MBodyMeterConfig.MutableArray`

  - ### Field Summary

    - ### Fields inherited from class com.h3c.of.lib.OpenflowStructure

      `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MBodyMutableMeterConfig(ProtocolVersion pv)` Constructs a mutable multipart body METER_CONFIG element.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MBodyMutableMeterConfig` | `addBand(MeterBand band)` Adds a meter band to this meter config; Since 1.3.
    `MBodyMutableMeterConfig` | `meterFlags(Set<MeterFlag> flags)` Set the meter flags; Since 1.3.
    `MBodyMutableMeterConfig` | `meterId(MeterId meterId)` Sets the meter ID for this configuration; Since 1.3.
    `OpenflowStructure` | `toImmutable()` Returns an immutable instance of this structure.
    `String` | `toString()`
    `boolean` | `writable()` Returns true if this mutable object is still writable.

    - ### Methods inherited from class com.h3c.of.lib.mp.MBodyMeterConfig

      `getBands, getFlags, getMeterId, getTotalLength, toDebugString, validate`

    - ### Methods inherited from class com.h3c.of.lib.OpenflowStructure

      `getVersion, hex, hex`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.h3c.of.lib.Structure

      `getVersion, toDebugString`

- - ### Constructor Detail

    - #### MBodyMutableMeterConfig

          public MBodyMutableMeterConfig(ProtocolVersion pv)

      Constructs a mutable multipart body METER_CONFIG element.

      Note that a freshly constructed instance has `MeterId.ALL` as the default meter id value, and initialized with an empty set of `MeterFlag`.

      Parameters:
        `pv` - the protocol version

  - ### Method Detail

    - #### toImmutable

          public OpenflowStructure toImmutable()

      Description copied from interface: `MutableStructure`
      Returns an immutable instance of this structure. In essence, converts this structure to be read-only.

      It is expected that the reference to this mutable structure will be dropped. Note that all method calls invoked on a `MutableStructure` after `toImmutable()` has been invoked will result in an `InvalidMutableException` being thrown.

      Specified by:
        `toImmutable` in interface `MutableStructure`
      Returns:
        an immutable instance of this structure.

    - #### writable

          public boolean writable()

      Description copied from interface: `MutableObject`
      Returns true if this mutable object is still writable. That is, the `#toImmutable()` method (defined on a sub-interface) has not yet been invoked.
      Specified by:
        `writable` in interface `MutableObject`
      Returns:
        true if this mutable object is still writable

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `MBodyMeterConfig`

    - #### meterId

          public MBodyMutableMeterConfig meterId(MeterId meterId)

      Sets the meter ID for this configuration; Since 1.3.
      Parameters:
        `meterId` - the meter ID
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `VersionMismatchException` - if version is < 1.3
        `NullPointerException` - if meterId is null

    - #### meterFlags

          public MBodyMutableMeterConfig meterFlags(Set<MeterFlag> flags)

      Set the meter flags; Since 1.3.
      Parameters:
        `flags` - the meter flags
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `VersionMismatchException` - if version is < 1.3
        `NullPointerException` - if flags is null

    - #### addBand

          public MBodyMutableMeterConfig addBand(MeterBand band)

      Adds a meter band to this meter config; Since 1.3.
      Parameters:
        `band` - the meter band to add
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `VersionMismatchException` - if version is < 1.3
        `NullPointerException` - if band is null

Copyright © 2014. All Rights Reserved.