Package za.co.wethinkcode.robots.client
Class Client
java.lang.Object
za.co.wethinkcode.robots.client.Client
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyMuteFlag(String[] args) Apply the mute flag from CLI args: disables all audio for testing/headless.getPort()The scanner this robot is usingbooleanstatic voidvoidreceiveFromGUI(String message) voidsetHandler(ClientHandler handler) voidstart()validateIp(String ipAddress) intvalidatePort(Integer selectedPort) Validate that the given port is within the acceptable range of port numbers
-
Constructor Details
-
Client
- Parameters:
in-args-
-
-
Method Details
-
main
-
getScanner
The scanner this robot is using -
getClientOptions
- Returns:
- the Picocli options for this client
-
getParser
- Returns:
- the
CliParserbeing used
-
validatePort
Validate that the given port is within the acceptable range of port numbers- Parameters:
selectedPort- the port given byclientOptions- Returns:
- a valid port number
-
validateIp
-
getIpAddress
-
getPort
-
setHandler
-
getMemory
-
start
public void start() -
applyMuteFlag
Apply the mute flag from CLI args: disables all audio for testing/headless.- Parameters:
args- the original CLI arguments passed to main
-
isAudioMuted
public boolean isAudioMuted()- Returns:
- true if audio is muted
-
receiveFromGUI
public void receiveFromGUI(String message) throws IOException, ExecutionException, InterruptedException
-