Class CommandRequest
java.lang.Object
za.co.wethinkcode.robots.server.commands.CommandRequest
Data Transfer Object (DTO) representing a client command request.
This class models the structure of an incoming command after it has been deserialized from JSON. It acts as an intermediate representation between the transport layer and the command layer, allowing the server to separate JSON parsing from command creation.
Instances of this class are consumed by the CommandFactory, which
uses the contained data to instantiate the appropriate concrete
Command implementation.
This class contains no business logic and exists solely to transport request data within the application.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the arguments supplied for the command.Returns the command requested by the client.getRobot()Returns the name of the robot that will execute the command.
-
Constructor Details
-
CommandRequest
public CommandRequest()
-
-
Method Details
-
getRobot
Returns the name of the robot that will execute the command.- Returns:
- the robot name supplied by the client
-
getCommand
Returns the command requested by the client.- Returns:
- the command name
-
getArguments
Returns the arguments supplied for the command.The meaning and number of arguments depend on the specific command being executed. Argument validation and conversion are performed by the
CommandFactory.- Returns:
- the command arguments in the order supplied by the client
-