com.h3c.of.lib.mp

## Class MBodyMutablePortStats

- java.lang.Object
- - com.h3c.of.lib.OpenflowStructure
  - - com.h3c.of.lib.mp.MBodyPortStats
    - - com.h3c.of.lib.mp.MBodyMutablePortStats

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

      public class MBodyMutablePortStats
      extends MBodyPortStats
      implements MutableStructure

  Mutable subclass of `MBodyPortStats`.

- - ### Nested Class Summary

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

      `MBodyPortStats.Array, MBodyPortStats.MutableArray`

  - ### Field Summary

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

      `version`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MBodyMutablePortStats` | `collisions(long collisions)` Sets the number of collisions; Since 1.0.
    `MBodyMutablePortStats` | `duration(long seconds, long nano)` Sets the time the group has been alive; Since 1.3.
    `MBodyMutablePortStats` | `port(BigPortNumber port)` Sets the port number; Since 1.0.
    `MBodyMutablePortStats` | `rxBytes(long rxBytes)` Sets the number of bytes received by this port; Since 1.0.
    `MBodyMutablePortStats` | `rxCrcErr(long rxCrcErr)` Sets the number of CRC error packets received by this port; Since 1.0.
    `MBodyMutablePortStats` | `rxDropped(long rxDropped)` Sets the number of packets dropped by this port at receiving end; Since 1.0.
    `MBodyMutablePortStats` | `rxErrors(long rxErrors)` Sets the number of error packets received by this port; Since 1.0.
    `MBodyMutablePortStats` | `rxFrameErr(long rxFrameErr)` Sets the number of frame alignment error packets received by this port; Since 1.0.
    `MBodyMutablePortStats` | `rxOverErr(long rxOverErr)` Sets the number of overrun error packets received by this port; Since 1.0.
    `MBodyMutablePortStats` | `rxPackets(long rxPackets)` Sets the number of packets received by this port; Since 1.0.
    `OpenflowStructure` | `toImmutable()` Returns an immutable instance of this structure.
    `String` | `toString()`
    `MBodyMutablePortStats` | `txBytes(long txBytes)` Sets the number of bytes transmitted by this port; Since 1.0.
    `MBodyMutablePortStats` | `txDropped(long txDropped)` Sets the number of packets dropped by this port at transmitting end; Since 1.0.
    `MBodyMutablePortStats` | `txErrors(long txErrors)` Sets the number of transmit error packets; Since 1.0.
    `MBodyMutablePortStats` | `txPackets(long txPackets)` Sets the number of packets transmitted by this port; Since 1.0.
    `boolean` | `writable()` Returns true if this mutable object is still writable.

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

      `getCollisions, getDurationNsec, getDurationSec, getPort, getRxBytes, getRxCRCErr, getRxDropped, getRxErrors, getRxFrameErr, getRxOverErr, getRxPackets, getTotalLength, getTxBytes, getTxDropped, getTxErrors, getTxPackets, 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

    - #### MBodyMutablePortStats

          public MBodyMutablePortStats(ProtocolVersion pv)

      Constructs a mutable multipart body PORT_STATS element.

      A valid `Port` 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 `MBodyPortStats`

    - #### port

          public MBodyMutablePortStats port(BigPortNumber port)

      Sets the port number; Since 1.0.

      Note that in 1.0, port numbers are u16.

      Parameters:
        `port` - the port number
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if port is null
        `IllegalArgumentException` - if the port number is invalid

    - #### rxPackets

          public MBodyMutablePortStats rxPackets(long rxPackets)

      Sets the number of packets received by this port; Since 1.0.
      Parameters:
        `rxPackets` - the number of received packets
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### txPackets

          public MBodyMutablePortStats txPackets(long txPackets)

      Sets the number of packets transmitted by this port; Since 1.0.
      Parameters:
        `txPackets` - the number of transmitted packets
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### rxBytes

          public MBodyMutablePortStats rxBytes(long rxBytes)

      Sets the number of bytes received by this port; Since 1.0.
      Parameters:
        `rxBytes` - the number of received bytes
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### txBytes

          public MBodyMutablePortStats txBytes(long txBytes)

      Sets the number of bytes transmitted by this port; Since 1.0.
      Parameters:
        `txBytes` - the number of transmitted bytes
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### rxDropped

          public MBodyMutablePortStats rxDropped(long rxDropped)

      Sets the number of packets dropped by this port at receiving end; Since 1.0.
      Parameters:
        `rxDropped` - the number of dropped packets
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### txDropped

          public MBodyMutablePortStats txDropped(long txDropped)

      Sets the number of packets dropped by this port at transmitting end; Since 1.0.
      Parameters:
        `txDropped` - the number of dropped packets
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### rxErrors

          public MBodyMutablePortStats rxErrors(long rxErrors)

      Sets the number of error packets received by this port; Since 1.0.
      Parameters:
        `rxErrors` - the number of packets with error
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### txErrors

          public MBodyMutablePortStats txErrors(long txErrors)

      Sets the number of transmit error packets; Since 1.0.
      Parameters:
        `txErrors` - the number of packets with error
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### rxFrameErr

          public MBodyMutablePortStats rxFrameErr(long rxFrameErr)

      Sets the number of frame alignment error packets received by this port; Since 1.0.
      Parameters:
        `rxFrameErr` - the number of packets with frame alignment error
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### rxOverErr

          public MBodyMutablePortStats rxOverErr(long rxOverErr)

      Sets the number of overrun error packets received by this port; Since 1.0.
      Parameters:
        `rxOverErr` - the number of packets with overrun error
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### rxCrcErr

          public MBodyMutablePortStats rxCrcErr(long rxCrcErr)

      Sets the number of CRC error packets received by this port; Since 1.0.
      Parameters:
        `rxCrcErr` - the number of packets with CRC error
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### collisions

          public MBodyMutablePortStats collisions(long collisions)

      Sets the number of collisions; Since 1.0.
      Parameters:
        `collisions` - the number of collisions
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable

    - #### duration

          public MBodyMutablePortStats 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

Copyright © 2014. All Rights Reserved.