com.h3c.of.lib.mp

## Class MBodyMutableGroupStats

- java.lang.Object
- - com.h3c.of.lib.OpenflowStructure
  - - com.h3c.of.lib.mp.MBodyGroupStats
    - - com.h3c.of.lib.mp.MBodyMutableGroupStats

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

      public class MBodyMutableGroupStats
      extends MBodyGroupStats
      implements MutableStructure

  Mutable subclass of `MBodyGroupStats`.

- - ### Nested Class Summary

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

      `MBodyGroupStats.Array, MBodyGroupStats.BucketCounter, MBodyGroupStats.MutableArray`

  - ### Field Summary

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

      `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MBodyMutableGroupStats(ProtocolVersion pv)` Constructs a mutable multipart body GROUP stats element.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MBodyMutableGroupStats` | `addBucketStats(long packets, long bytes)` Sets the list of bucket stats for this group; Since 1.1.
    `MBodyMutableGroupStats` | `byteCount(long byteCount)` Sets the number of bytes processed by this group; Since 1.1.
    `MBodyMutableGroupStats` | `duration(long seconds, long nano)` Sets the time the group has been alive; Since 1.3.
    `MBodyMutableGroupStats` | `groupId(GroupId groupId)` Sets the group ID; Since 1.1.
    `MBodyMutableGroupStats` | `packetCount(long packetCount)` Sets the number of packets processed by this group; Since 1.1.
    `MBodyMutableGroupStats` | `refCount(long refCount)` Sets the number of flows or groups that directly forward to this group; Since 1.1.
    `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.MBodyGroupStats

      `getBucketStats, getByteCount, getDurationNsec, getDurationSec, getGroupId, getPacketCount, getRefCount, 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

    - #### MBodyMutableGroupStats

          public MBodyMutableGroupStats(ProtocolVersion pv)

      Constructs a mutable multipart body GROUP stats element.

      A valid `GroupId` must be present for this element to be valid.

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

    - #### groupId

          public MBodyMutableGroupStats groupId(GroupId groupId)

      Sets the group ID; Since 1.1.
      Parameters:
        `groupId` - the group ID
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if groupId is null

    - #### duration

          public MBodyMutableGroupStats duration(long seconds,
                                        long nano)

      Sets the time the group has been alive; Since 1.3.

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

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

    - #### refCount

          public MBodyMutableGroupStats refCount(long refCount)

      Sets the number of flows or groups that directly forward to this group; Since 1.1.
      Parameters:
        `refCount` - the number of flows or groups
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `IllegalArgumentException` - if priority is not u32

    - #### packetCount

          public MBodyMutableGroupStats packetCount(long packetCount)

      Sets the number of packets processed by this group; Since 1.1.
      Parameters:
        `packetCount` - the number of packets
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### byteCount

          public MBodyMutableGroupStats byteCount(long byteCount)

      Sets the number of bytes processed by this group; Since 1.1.
      Parameters:
        `byteCount` - the number of bytes
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### addBucketStats

          public MBodyMutableGroupStats addBucketStats(long packets,
                                              long bytes)

      Sets the list of bucket stats for this group; Since 1.1.
      Parameters:
        `packets` - the number of packets
        `bytes` - the number of bytes
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

Copyright © 2014. All Rights Reserved.