public class MockTextTerminal extends AbstractTextTerminal<MockTextTerminal>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_READS |
DEFAULT_USER_INTERRUPT_KEY, SYSPROP_PROPERTIES_FILE_LOCATION| Constructor and Description |
|---|
MockTextTerminal() |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getInputs() |
int |
getMaxReads() |
String |
getOutput() |
int |
getReadCalls() |
void |
println()
Terminates the current line by writing the line separator string.
|
void |
rawPrint(String message)
Prints the message in its raw form.
|
String |
read(boolean masking)
Reads a line of text
|
boolean |
registerUserInterruptHandler(Consumer<MockTextTerminal> handler,
boolean abortRead)
Registers a handler that will be called in response to a user interrupt.
|
void |
setMaxReads(int maxReads) |
static String |
stripAll(String text) |
addDefaultProperty, getDefaultProperties, getProperties, getPropertiesPrefixes, getPropertiesReader, init, initProperties, initProperties, initPropertiespublic static final int DEFAULT_MAX_READS
public String read(boolean masking)
TextTerminalmasking - true, if the input should be masked (for example to enter a password)public void rawPrint(String message)
TextTerminalpublic void println()
TextTerminalpublic String getOutput()
public int getReadCalls()
public int getMaxReads()
public void setMaxReads(int maxReads)
public boolean registerUserInterruptHandler(Consumer<MockTextTerminal> handler, boolean abortRead)
TextTerminalhandler - the action to be performed in response to a user interrupt.abortRead - true, if the current read operation should be aborted on user interrupt.