Package za.co.wethinkcode.robots.client
Class ClientSideServerResponse
java.lang.Object
za.co.wethinkcode.robots.client.ClientSideServerResponse
- All Implemented Interfaces:
ServerResponse
Primarily utility response to instantiate server responses on the client side.
A concrete implementation of
ServerResponse interface.
NOTE: is subject to depreciation due to unwieldy/inelegant abstraction-
Nested Class Summary
Nested classes/interfaces inherited from interface za.co.wethinkcode.robots.shared.ServerResponse
ServerResponse.ServerResponseCode -
Constructor Summary
ConstructorsConstructorDescriptionNo arg constructor for reflectionClientSideServerResponse(Map<String, Object> data, ServerResponse.ServerResponseCode result, RobotState state) Constructor for ClientSideServerResponse without state -
Method Summary
Modifier and TypeMethodDescriptiongetData()Getter for a server responses' dataGet the message from a server response data (really good for error handling)public getter for a server's response to being given datagetState()Getter for the robot state associated with this target botvoidvoidsetState(RobotState state)
-
Constructor Details
-
ClientSideServerResponse
public ClientSideServerResponse()No arg constructor for reflection
-
-
Method Details
-
getData
Getter for a server responses' data- Specified by:
getDatain interfaceServerResponse- Returns:
- the data map
-
setState
-
setData
-
getResult
public getter for a server's response to being given data- Specified by:
getResultin interfaceServerResponse- Returns:
- an acceptable response code.
-
getMessage
Get the message from a server response data (really good for error handling)- Specified by:
getMessagein interfaceServerResponse- Returns:
- a String of the server response's message
-
getState
Getter for the robot state associated with this target bot- Returns:
- the current Robot State
-