public class CLIInteractionUtilities extends Object
| Constructor and Description |
|---|
CLIInteractionUtilities() |
| Modifier and Type | Method and Description |
|---|---|
static String |
readLineFromStdIn()
Reads a line from standard input.
|
static String |
readLineFromStdInWithMessage(String message)
Prints a message to standard output and then reads a line from standard
input.
|
static String |
readLineFromStdInWithMessage(String message,
String defaultResponse)
Prints a message and also displays a default response that is
automatically if the user does not explicitly specifies a response, i.e.
|
static boolean |
readYesNoFromStdInWithMessage(String message)
Prints a message and appends the string "(y/n)" to indicate a y(es) or
n(o) response where the long forms are also accepted.
|
static boolean |
readYesNoFromStdInWithMessage(String message,
boolean defaultResponse)
Prints a message and reads a yes or no answer where the defaultResponse
it used if the user just hits enter without typing a response.
|
public static String readLineFromStdIn() throws IOException
IOException - If reading the line fails.public static String readLineFromStdInWithMessage(String message) throws IOException
message - The message to print.IOException - If reading fails.public static String readLineFromStdInWithMessage(String message, String defaultResponse) throws IOException
message - The message to print.defaultResponse - The default response.IOException - If reading the input fails.public static boolean readYesNoFromStdInWithMessage(String message) throws IOException
message - The message to display.IOException - If reading the input fails.public static boolean readYesNoFromStdInWithMessage(String message, boolean defaultResponse) throws IOException
message - The message to print.defaultResponse - The default response.IOException - If reading the line fails.Copyright © 2019 JULIE Lab, Germany. All rights reserved.