com.h3c.of.lib.mp

## Class MBodyMutableDesc

- java.lang.Object
- - com.h3c.of.lib.OpenflowStructure
  - - com.h3c.of.lib.mp.MBodyDesc
    - - com.h3c.of.lib.mp.MBodyMutableDesc

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

      public class MBodyMutableDesc
      extends MBodyDesc
      implements MutableStructure

  Mutable subclass of `MBodyDesc`.

- - ### Field Summary

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

      `version`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MBodyMutableDesc` | `dpDesc(String dpDesc)` Sets the human readable description of the datapath; Since 1.0.
    `MBodyMutableDesc` | `hwDesc(String hwDesc)` Sets the hardware description; Since 1.0.
    `MBodyMutableDesc` | `mfrDesc(String mfrDesc)` Sets the manufacturer description; Since 1.0.
    `MBodyMutableDesc` | `serialNum(String serialNum)` Sets the serial number; Since 1.0.
    `MBodyMutableDesc` | `swDesc(String swDesc)` Sets the software description; Since 1.0.
    `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.MBodyDesc

      `getDpDesc, getHwDesc, getMfrDesc, getSerialNum, getSwDesc, getTotalLength, toDebugString`

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

      `getVersion, hex, hex, validate`

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

    - ### Methods inherited from interface com.h3c.of.lib.mp.MultipartBody

      `validate`

- - ### Constructor Detail

    - #### MBodyMutableDesc

          public MBodyMutableDesc(ProtocolVersion pv)

      Constructs a mutable multipart body DESC type.
      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 `MBodyDesc`

    - #### mfrDesc

          public MBodyMutableDesc mfrDesc(String mfrDesc)

      Sets the manufacturer description; Since 1.0. Note that the maximum allowed length of the string is `MpBodyFactory.DESC_STR_LEN` - 1.
      Parameters:
        `mfrDesc` - the manufacturer description
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if mfrDesc is null
        `IllegalArgumentException` - if string length is >255

    - #### hwDesc

          public MBodyMutableDesc hwDesc(String hwDesc)

      Sets the hardware description; Since 1.0. Note that the maximum allowed length of the string is `MpBodyFactory.DESC_STR_LEN` - 1.
      Parameters:
        `hwDesc` - the hardware description
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if hwDesc is null
        `IllegalArgumentException` - if string length is >255

    - #### swDesc

          public MBodyMutableDesc swDesc(String swDesc)

      Sets the software description; Since 1.0. Note that the maximum allowed length of the string is `MpBodyFactory.DESC_STR_LEN` - 1.
      Parameters:
        `swDesc` - the software description
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if swDesc is null
        `IllegalArgumentException` - if string length is >255

    - #### serialNum

          public MBodyMutableDesc serialNum(String serialNum)

      Sets the serial number; Since 1.0. Note that the maximum allowed length of the string is `MpBodyFactory.SERIAL_NUM_LEN` - 1.
      Parameters:
        `serialNum` - the serial number
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if serialNum is null
        `IllegalArgumentException` - if string length is >31

    - #### dpDesc

          public MBodyMutableDesc dpDesc(String dpDesc)

      Sets the human readable description of the datapath; Since 1.0. Note that the maximum allowed length of the string is `MpBodyFactory.DESC_STR_LEN` - 1.
      Parameters:
        `dpDesc` - the datapath description
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if dpDesc is null
        `IllegalArgumentException` - if string length is >255

Copyright © 2014. All Rights Reserved.