Package com.google.gerrit.pgm.init.api
Class ConsoleUI
- java.lang.Object
- 
- com.google.gerrit.pgm.init.api.ConsoleUI
 
- 
 public abstract class ConsoleUI extends Object Console based interaction with the invoking user.
- 
- 
Constructor SummaryConstructors Constructor Description ConsoleUI()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static Dieabort()Constructs an exception indicating the user aborted the operation.voiderror(String format, Object... args)Display an error message on the system stderr.static ConsoleUIgetInstance()Get a UI instance, assuming interactive mode.static ConsoleUIgetInstance(boolean batchMode)Get a UI instance, possibly forcing batch mode.abstract voidheader(String fmt, Object... args)Display a header message before a series of prompts.abstract booleanisBatch()Returns true if this is a batch UI that has no user interaction.abstract voidmessage(String fmt, Object... args)Display a message.abstract Stringpassword(String fmt, Object... args)Prompt the user for a password, returning the string; null if blank.abstract <T extends Enum<?>,A extends EnumSet<? extends T>>
 TreadEnum(T def, A options, String fmt, Object... args)Prompt the user to make a choice from an enumeration's values.intreadInt(int def, String fmt, Object... args)Prompt 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 StringreadString(String def, Set<String> allowedValues, String fmt, Object... args)Prompt the user to make a choice from an allowed list of values.abstract voidwaitForUser()Prints a message asking the user to let us know when its safe to continue.abstract booleanyesno(Boolean def, String fmt, Object... args)Request the user to answer a yes/no question.
 
- 
- 
- 
Method Detail- 
getInstancepublic static ConsoleUI getInstance() Get a UI instance, assuming interactive mode.
 - 
getInstancepublic static ConsoleUI getInstance(boolean batchMode) Get a UI instance, possibly forcing batch mode.
 - 
abortprotected static Die abort() Constructs 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.
 - 
headerpublic abstract void header(String fmt, Object... args) Display a header message before a series of prompts.
 - 
yesnopublic abstract boolean yesno(Boolean def, String fmt, Object... args) Request 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.
 - 
readStringpublic abstract String readString(String def, String fmt, Object... args) Prompt 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.
 - 
readIntpublic int readInt(int def, String fmt, Object... args)Prompt the user for an integer value, suggesting a default.
 - 
passwordpublic abstract String password(String fmt, Object... args) Prompt the user for a password, returning the string; null if blank.
 - 
error@FormatMethod public void error(String format, Object... args) Display an error message on the system stderr.
 
- 
 
-