corda / com.r3.corda.networkmanage.common.shell / ShellCommandHandler

ShellCommandHandler

class ShellCommandHandler : ShellCommands

This class allows for interacting with an interactive shell by invoking external methods, as well as retrieving user input.

Constructors

<init>

ShellCommandHandler(renderer: Renderer)

This class allows for interacting with an interactive shell by invoking external methods, as well as retrieving user input.

Properties

renderer

val renderer: Renderer

Functions

getBooleanInput

fun getBooleanInput(promptString: String): Boolean?

Prompts the user for boolean input (Y/N), returning the appropriate boolean value or null if user cancelled. renderer is the class responsible for rendering the user options on the screen and reading user input.

getStringInput

fun getStringInput(promptString: String, possibleValues: Set<String>?): String?

Prompts the user for input, printing the promptString. Validates the input is not null or blank, re-requesting input if invalid. Also validates that input is one of the given possibleValues (if not null). renderer is the class responsible for rendering the user options on the screen and reading user input.

showMenu

fun showMenu(menuOptions: MenuOptions): Unit

Parses all labels and the associated methods to be called to construct a menu which will be displayed via the renderer.