Class RobotWorldJsonClient

java.lang.Object
za.co.wethinkcode.robots.client.RobotWorldJsonClient
All Implemented Interfaces:
RobotWorldClient

public class RobotWorldJsonClient extends Object implements RobotWorldClient
  • Constructor Details

    • RobotWorldJsonClient

      public RobotWorldJsonClient()
  • Method Details

    • connect

      public void connect(String ipAddress, int port)
      Description copied from interface: RobotWorldClient
      Connects to the Robot Worlds server on specified ip address and port
      Specified by:
      connect in interface RobotWorldClient
      Parameters:
      ipAddress - either `localhost` or actual IP address
      port - port that server is configured to receive connections on
    • isConnected

      public boolean isConnected()
      Description copied from interface: RobotWorldClient
      Checks if client is connected to server
      Specified by:
      isConnected in interface RobotWorldClient
      Returns:
    • disconnect

      public void disconnect()
      Description copied from interface: RobotWorldClient
      Disconnect from server
      Specified by:
      disconnect in interface RobotWorldClient
    • sendRequest

      public com.fasterxml.jackson.databind.JsonNode sendRequest(String requestJsonString)
      Description copied from interface: RobotWorldClient
      Sends a request presented by the Json object to the server
      Specified by:
      sendRequest in interface RobotWorldClient
      Parameters:
      requestJsonString - a String representing the Json string to send to server
      Returns:
      the response as a JsonNode
    • sendRequestAsString

      public String sendRequestAsString(String requestString)
      Specified by:
      sendRequestAsString in interface RobotWorldClient