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

ShellCommands

interface ShellCommands

Shell commands interface allowing for interacting with a shell by retrieving user inputs and rendering menus.

Functions

getBooleanInput

abstract 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

abstract fun getStringInput(promptString: String, possibleValues: Set<String>? = null): 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

abstract 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.

Inheritors

ShellCommandHandler

class ShellCommandHandler : ShellCommands

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