com.h3c.of.sw

## Class ScenarioCommand

- java.lang.Object
- - com.h3c.of.sw.ScenarioCommand

- Direct Known Subclasses:
    CmdDelay, CmdDirective, CmdEchoRequest, CmdPortStatus, CmdSwitchVerb

      public class ScenarioCommand
      extends Object

  An embodiment of a command in a mock-switch-bank scenario.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `E_INV_PARAMS`
    `protected String` | `error`
    `protected String` | `params`
    `protected CommandType` | `type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScenarioCommand(CommandType type, String params)` Constructs a scenario command.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ScenarioCommand` | `create(CommandType type, String params)` Returns a command encapsulating the given parameters.
    `CommandType` | `getType()` Returns the command type.
    `String` | `toString()`
    `String` | `validate()` Validates the command; returns null if all is well, or a short string describing the problem.

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

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

- - ### Field Detail

    - #### E_INV_PARAMS

          protected static final String E_INV_PARAMS

    - #### type

          protected final CommandType type

    - #### params

          protected final String params

    - #### error

          protected String error

  - ### Constructor Detail

    - #### ScenarioCommand

          public ScenarioCommand(CommandType type,
                         String params)

      Constructs a scenario command.
      Parameters:
        `type` - the command type
        `params` - the command parameters

  - ### Method Detail

    - #### getType

          public CommandType getType()

      Returns the command type.
      Returns:
        the command type

    - #### validate

          public String validate()

      Validates the command; returns null if all is well, or a short string describing the problem.
      Returns:
        a validation error string; or null

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### create

          public static ScenarioCommand create(CommandType type,
                               String params)

      Returns a command encapsulating the given parameters.
      Parameters:
        `type` - the command type
        `params` - the parameters
      Returns:
        the command

Copyright © 2014. All Rights Reserved.