Package it.polito.appeal.traci.protocol

## Class ResponseContainer

- java.lang.Object
- - it.polito.appeal.traci.protocol.ResponseContainer

-     public class ResponseContainer
      extends Object

  Represents all the information related to a given request. It contains a mandatory status response, an optional response command and an optional list of sub-responses.
  Author:
    Enrico Gueli <enrico.gueli@polito.it>

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ResponseContainer​(StatusResponse status, Command response)` | Constructor for a response container with status response and a response command.
    `ResponseContainer​(StatusResponse status, Command response, List<Command> subResponses)` | Constructor for a response container with status response, response command and zero or more sub-responses.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Command` | `getResponse()` |
    `StatusResponse` | `getStatus()` | Returns the status response
    `List<Command>` | `getSubResponses()` |

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

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

- - ### Constructor Detail

    - #### ResponseContainer

          public ResponseContainer​(StatusResponse status,
                                   Command response,
                                   List<Command> subResponses)

      Constructor for a response container with status response, response command and zero or more sub-responses.
      Parameters:
        `status` - status
        `response` - response
        `subResponses` - sub response

    - #### ResponseContainer

          public ResponseContainer​(StatusResponse status,
                                   Command response)

      Constructor for a response container with status response and a response command.
      Parameters:
        `status` - status
        `response` - response

  - ### Method Detail

    - #### getStatus

          public StatusResponse getStatus()

      Returns the status response
      Returns:
        the status

    - #### getResponse

          public Command getResponse()

      Returns:
        the response command. It may return `null` if there is no response to such command (i.e. a command that changes something in the simulation state or the close command)

    - #### getSubResponses

          public List<Command> getSubResponses()

      Returns:
        the sub-responses of this response container. It may return `null` if there are no sub-responses to such command (i.e. commands different than CMD_SIMSTEP2)