Package com.google.gerrit.pgm.init.api
Class ConsoleUI
java.lang.Object
com.google.gerrit.pgm.init.api.ConsoleUI
Console based interaction with the invoking user.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected static Dieabort()Constructs an exception indicating the user aborted the operation.voidDisplay an error message on the system stderr.static ConsoleUIGet a UI instance, assuming interactive mode.static ConsoleUIgetInstance(boolean batchMode) Get a UI instance, possibly forcing batch mode.abstract voidDisplay a header message before a series of prompts.abstract booleanisBatch()Returns true if this is a batch UI that has no user interaction.abstract voidDisplay a message.abstract StringPrompt the user for a password, returning the string; null if blank.Prompt the user to make a choice from an enumeration's values.intPrompt the user for an integer value, suggesting a default.abstract StringreadString(String def, String fmt, Object... args) Prompt the user for a string, suggesting a default, and returning choice.abstract StringPrompt the user to make a choice from an allowed list of values.abstract voidPrints a message asking the user to let us know when its safe to continue.abstract booleanRequest the user to answer a yes/no question.
- 
Constructor Details- 
ConsoleUIpublic ConsoleUI()
 
- 
- 
Method Details- 
getInstanceGet a UI instance, assuming interactive mode.
- 
getInstanceGet a UI instance, possibly forcing batch mode.
- 
abortConstructs an exception indicating the user aborted the operation.
- 
isBatchpublic abstract boolean isBatch()Returns true if this is a batch UI that has no user interaction.
- 
headerDisplay a header message before a series of prompts.
- 
messageDisplay a message.
- 
yesnoRequest the user to answer a yes/no question.
- 
waitForUserpublic abstract void waitForUser()Prints a message asking the user to let us know when its safe to continue.
- 
readStringPrompt the user for a string, suggesting a default, and returning choice.
- 
readStringpublic abstract String readString(String def, Set<String> allowedValues, String fmt, Object... args) Prompt the user to make a choice from an allowed list of values.
- 
readIntPrompt the user for an integer value, suggesting a default.
- 
passwordPrompt the user for a password, returning the string; null if blank.
- 
errorDisplay an error message on the system stderr.
- 
readEnumpublic abstract <T extends Enum<?>,A extends EnumSet<? extends T>> T readEnum(T def, A options, String fmt, Object... args) Prompt the user to make a choice from an enumeration's values.
 
-