Modifier and Type | Field and Description |
---|---|
protected List<String> |
choices |
protected boolean |
isPassword |
protected String |
lastErrorMessage |
protected String |
message |
protected int |
minLength |
protected Scanner |
scanner |
protected Pattern |
validPattern |
Constructor and Description |
---|
Prompter(Scanner scanner,
String message) |
Prompter(String message) |
Modifier and Type | Method and Description |
---|---|
String |
failAndPromptAgain() |
String |
getLastErrorMessage() |
String |
prompt() |
static String |
prompt(String msg) |
Prompter |
setAllowEmpty(boolean allow) |
Prompter |
setChoices(List<String> choices) |
Prompter |
setChoices(String... choices) |
Prompter |
setIsPassword(boolean isPassword) |
Prompter |
setLastErrorMessage(String lastErrorMessage) |
Prompter |
setMinLength(int minLength) |
Prompter |
setValidPattern(String patternString) |
boolean |
validate(String line) |
boolean |
yesNo() |
protected Pattern validPattern
protected boolean isPassword
protected String lastErrorMessage
protected int minLength
public String failAndPromptAgain()
public boolean yesNo()
public Prompter setValidPattern(String patternString)
public Prompter setChoices(String... choices)
public Prompter setChoices(List<String> choices)
public Prompter setAllowEmpty(boolean allow)
public Prompter setMinLength(int minLength)
public Prompter setIsPassword(boolean isPassword)
public String getLastErrorMessage()
public Prompter setLastErrorMessage(String lastErrorMessage)
Copyright © 2016. All rights reserved.