Package za.co.wethinkcode.robots.client
Class RobotWorldJsonClient
java.lang.Object
za.co.wethinkcode.robots.client.RobotWorldJsonClient
- All Implemented Interfaces:
RobotWorldClient
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConnects to the Robot Worlds server on specified ip address and portvoidDisconnect from serverbooleanChecks if client is connected to servercom.fasterxml.jackson.databind.JsonNodesendRequest(String requestJsonString) Sends a request presented by the Json object to the serversendRequestAsString(String requestString)
-
Constructor Details
-
RobotWorldJsonClient
public RobotWorldJsonClient()
-
-
Method Details
-
connect
Description copied from interface:RobotWorldClientConnects to the Robot Worlds server on specified ip address and port- Specified by:
connectin interfaceRobotWorldClient- Parameters:
ipAddress- either `localhost` or actual IP addressport- port that server is configured to receive connections on
-
isConnected
public boolean isConnected()Description copied from interface:RobotWorldClientChecks if client is connected to server- Specified by:
isConnectedin interfaceRobotWorldClient- Returns:
-
disconnect
public void disconnect()Description copied from interface:RobotWorldClientDisconnect from server- Specified by:
disconnectin interfaceRobotWorldClient
-
sendRequest
Description copied from interface:RobotWorldClientSends a request presented by the Json object to the server- Specified by:
sendRequestin interfaceRobotWorldClient- Parameters:
requestJsonString- a String representing the Json string to send to server- Returns:
- the response as a JsonNode
-
sendRequestAsString
- Specified by:
sendRequestAsStringin interfaceRobotWorldClient
-