com.h3c.of.lib

## Class OpenflowStructure

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

- All Implemented Interfaces:
    Structure
  Direct Known Subclasses:
    Action, Bucket, HelloElement, Instruction, Match, MatchField, MBodyDesc, MBodyExperimenter, MBodyFlowStats, MBodyFlowStatsRequest, MBodyGroupDescStats, MBodyGroupFeatures, MBodyGroupStats, MBodyGroupStatsRequest, MBodyList, MBodyMeterConfig, MBodyMeterFeatures, MBodyMeterRequest, MBodyMeterStats, MBodyPortDesc, MBodyPortStats, MBodyPortStatsRequest, MBodyQueueStats, MBodyQueueStatsRequest, MBodyTableFeatures, MBodyTableStats, MeterBand, Port, Queue

      public abstract class OpenflowStructure
      extends Object
      implements Structure

  Base class for all OpenFlow structures.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ProtocolVersion` | `version` Every structure knows what version it is representing.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OpenflowStructure(ProtocolVersion pv)` Constructs an OpenFlow structure.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ProtocolVersion` | `getVersion()` Returns the protocol version of this OpenFlow structure.
    `protected static String` | `hex(int value)` Returns the given int as a string in hex form.
    `protected static String` | `hex(long value)` Returns the given long as a string in hex form.
    `String` | `toDebugString()` Returns a string representation useful for debugging.
    `String` | `toString()`
    `void` | `validate()` Validates this structure for completeness and throws an exception if the structure is considered "not complete".

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

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

- - ### Field Detail

    - #### version

          protected final ProtocolVersion version

      Every structure knows what version it is representing.

  - ### Constructor Detail

    - #### OpenflowStructure

          public OpenflowStructure(ProtocolVersion pv)

      Constructs an OpenFlow structure.
      Parameters:
        `pv` - the protocol version

  - ### Method Detail

    - #### getVersion

          public ProtocolVersion getVersion()

      Description copied from interface: `Structure`
      Returns the protocol version of this OpenFlow structure.
      Specified by:
        `getVersion` in interface `Structure`
      Returns:
        the structure protocol version

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toDebugString

          public String toDebugString()

      Returns a string representation useful for debugging. This default implementation delegates to `toString()`, but subclasses are free to override this behavior.
      Specified by:
        `toDebugString` in interface `Structure`
      Returns:
        a (possibly multi-line) string representation of this message

    - #### validate

          public void validate()
                        throws IncompleteStructureException

      Validates this structure for completeness and throws an exception if the structure is considered "not complete".

      This default implementation does nothing, i.e. default behavior is that structures are considered complete.

      Subclasses should override this method to check that mandatory fields or other internal state is present, throwing an exception if it is not.

      Throws:
        `IncompleteStructureException` - if the structure is not complete

    - #### hex

          protected static String hex(long value)

      Returns the given long as a string in hex form.
      Parameters:
        `value` - the value
      Returns:
        the value in hex form

    - #### hex

          protected static String hex(int value)

      Returns the given int as a string in hex form.
      Parameters:
        `value` - the value
      Returns:
        the value in hex form

Copyright © 2014. All Rights Reserved.