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 Details

    • 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 Details

    • 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)