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 responseList<Command>
getSubResponses()
-
-
-
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
- statusresponse
- responsesubResponses
- sub response
-
ResponseContainer
public ResponseContainer(StatusResponse status, Command response)
Constructor for a response container with status response and a response command.- Parameters:
status
- statusresponse
- 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)
-
-