com.h3c.of.lib

## Class Mutable

- java.lang.Object
- - com.h3c.of.lib.Mutable

-     public final class Mutable
      extends Object

  Encapsulates the common state and behavior of mutable objects.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Mutable()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkWritable(MutableObject mo)` Checks that this mutable is still writable.
    `void` | `invalidate(MutableObject mo)` Invalidates this mutable, marking it forever unwritable.
    `void` | `resetWritable()`
    `String` | `tagString(String s)` Produces a tagged string, showing the writable state.
    `String` | `toString()`
    `boolean` | `writable()` Returns true if this mutable is still writable.

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

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

- - ### Constructor Detail

    - #### Mutable

          public Mutable()

  - ### Method Detail

    - #### checkWritable

          public void checkWritable(MutableObject mo)

      Checks that this mutable is still writable. If it is not, throw an exception, using the toString() of the specified enclosing object as the exception detail message.
      Parameters:
        `mo` - the enclosing mutable object

    - #### invalidate

          public void invalidate(MutableObject mo)

      Invalidates this mutable, marking it forever unwritable.
      Parameters:
        `mo` - the enclosing mutable object

    - #### tagString

          public String tagString(String s)

      Produces a tagged string, showing the writable state. The assumption is that the parameter is a toString() of an object, which begins with the following format:

               {tag:...}

      where `tag` is a short (typically 3 character) tag identifying the base class. For example, `"ofm"` for openflow message, or `"ofs"` for openflow structure.
      Parameters:
        `s` - the original string
      Returns:
        the tagged string

    - #### writable

          public boolean writable()

      Returns true if this mutable is still writable.
      Returns:
        true if writable

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### resetWritable

          public void resetWritable()

Copyright © 2014. All Rights Reserved.