com.h3c.of.lib.match

## Class MutableMatch

- java.lang.Object
- - com.h3c.of.lib.OpenflowStructure
  - - com.h3c.of.lib.match.Match
    - - com.h3c.of.lib.match.MutableMatch

- All Implemented Interfaces:
    MutableObject, MutableStructure, Structure

      public class MutableMatch
      extends Match
      implements MutableStructure

  Mutable subclass of `Match`.

- - ### Field Summary

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

      `version`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MutableMatch` | `addField(MatchField field)` Adds the specified match field to this match.
    `boolean` | `equals(Object o)`
    `List<MatchField>` | `fieldList()` Returns the fields in spec-defined order.
    `List<MatchField>` | `getMatchFields()` Returns the list of match fields, in the order they were defined in the match structure.
    `int` | `hashCode()`
    `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.match.Match

      `getMatchLength, getMatchType, getTotalLength, toDebugString, toDebugString`

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

      `getVersion, hex, hex, validate`

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

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

    - ### Methods inherited from interface com.h3c.of.lib.Structure

      `getVersion, toDebugString`

- - ### Method Detail

    - #### toImmutable

          public OpenflowStructure toImmutable()

      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.

      In addition, the match fields are validated to ensure that all their pre-requisites are met.

      Specified by:
        `toImmutable` in interface `MutableStructure`
      Returns:
        an immutable instance of this structure.
      Throws:
        `ValidationException` - if match field pre-requisites have not been met
        `InvalidMutableException` - if this structure is no longer writable

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

    - #### fieldList

          public List<MatchField> fieldList()

      Description copied from class: `Match`
      Returns the fields in spec-defined order.
      Overrides:
        `fieldList` in class `Match`
      Returns:
        the match fields in order

    - #### getMatchFields

          public List<MatchField> getMatchFields()

      Description copied from class: `Match`
      Returns the list of match fields, in the order they were defined in the match structure.
      Overrides:
        `getMatchFields` in class `Match`
      Returns:
        the list of match fields

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Match`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Match`

    - #### addField

          public MutableMatch addField(MatchField field)

      Adds the specified match field to this match. Note that the order in which the match fields are added to the match may be arbitrary. An exception will be thrown if a field type is duplicated.
      Parameters:
        `field` - the match field to add
      Returns:
        self, for chaining
      Throws:
        `InvalidMutableException` - if this instance is no longer writable
        `NullPointerException` - if field is null
        `IllegalArgumentException` - if the match field type is duplicated

Copyright © 2014. All Rights Reserved.