Package za.co.wethinkcode.robots.api
Class ClientAPI
java.lang.Object
za.co.wethinkcode.robots.api.ClientAPI
The Client API class provides generic methods for interacting with the Robot Worlds API as a client
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateRequest(String roboName, InputParser parser) builds a JSON request for the server.static StringextractMessage(String jsonResponse) static StringformatResponse(String jsonResponse) static com.google.gson.JsonObjectTake in the raw response from a server and format it as a JSON object
-
Constructor Details
-
ClientAPI
public ClientAPI()
-
-
Method Details
-
createRequest
builds a JSON request for the server. // format : { "robot": "name", "command": "cmd", "arguments": ["arg1"] } -
extractMessage
-
formatResponse
-
rawToJson
Take in the raw response from a server and format it as a JSON object- Parameters:
rawInput- the raw input received from the server- Returns:
-