com.h3c.of.lib.mp

## Class MBodyMutableMeterStats

- java.lang.Object
- - com.h3c.of.lib.OpenflowStructure
  - - com.h3c.of.lib.mp.MBodyMeterStats
    - - com.h3c.of.lib.mp.MBodyMutableMeterStats

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

      public class MBodyMutableMeterStats
      extends MBodyMeterStats
      implements MutableStructure

  Mutable subclass of `MBodyMeterStats`.

- - ### Nested Class Summary

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

      `MBodyMeterStats.Array, MBodyMeterStats.MeterBandStats, MBodyMeterStats.MutableArray`

  - ### Field Summary

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

      `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MBodyMutableMeterStats(ProtocolVersion pv)` Constructs a mutable multipart body METER_STATS type.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MBodyMutableMeterStats` | `addMeterBandStat(MBodyMeterStats.MeterBandStats meterBandStats)` Adds a `MBodyMeterStats.MeterBandStats` for the meter bands applied to this meter; Since 1.3.
    `MBodyMutableMeterStats` | `byteInCount(long byteInCount)` Sets the number of bytes in input for this meter; Since 1.3.
    `MBodyMutableMeterStats` | `duration(long seconds, long nano)` Sets the time this meter hes been alive; Since 1.3.
    `MBodyMutableMeterStats` | `flowCount(long flowCount)` Sets the count of flows bound to this meter; Since 1.3.
    `MBodyMutableMeterStats` | `meterId(MeterId meterId)` Sets the meter ID for this meter stats; Since 1.3.
    `MBodyMutableMeterStats` | `packetInCount(long packetInCount)` Sets the number of packet in input for this meter; 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.MBodyMeterStats

      `getBandStats, getByteInCount, getDurationNSec, getDurationSec, getFlowCount, getMeterId, getPktInCount, getTotalLength, toDebugString, 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

    - #### MBodyMutableMeterStats

          public MBodyMutableMeterStats(ProtocolVersion pv)

      Constructs a mutable multipart body METER_STATS type.

      Note the a freshly constructed instance has `MeterId.ALL` as the default meter id value.

      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 `MBodyMeterStats`

    - #### meterId

          public MBodyMutableMeterStats meterId(MeterId meterId)

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

    - #### flowCount

          public MBodyMutableMeterStats flowCount(long flowCount)

      Sets the count of flows bound to this meter; Since 1.3.
      Parameters:
        `flowCount` - the count of flows
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### packetInCount

          public MBodyMutableMeterStats packetInCount(long packetInCount)

      Sets the number of packet in input for this meter; Since 1.3.
      Parameters:
        `packetInCount` - the packet in count
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### byteInCount

          public MBodyMutableMeterStats byteInCount(long byteInCount)

      Sets the number of bytes in input for this meter; Since 1.3.
      Parameters:
        `byteInCount` - the packet in count
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### duration

          public MBodyMutableMeterStats duration(long seconds,
                                        long nano)

      Sets the time this meter hes been alive; Since 1.3.

      The first parameter is the number of seconds; the second is the additional number of nanoseconds.

      Parameters:
        `seconds` - the number of seconds
        `nano` - the additional number of nanoseconds
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `IllegalArgumentException` - if seconds or nano is not U32

    - #### addMeterBandStat

          public MBodyMutableMeterStats addMeterBandStat(MBodyMeterStats.MeterBandStats meterBandStats)

      Adds a `MBodyMeterStats.MeterBandStats` for the meter bands applied to this meter; Since 1.3.
      Parameters:
        `meterBandStats` - the meter band stats
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if meterBandStats is null

Copyright © 2014. All Rights Reserved.