public class BasicFreeChoicesHelper extends Object implements ChoicesHelper
ChoicesHelper
based on a free entry with possible check and conversionConstructor and Description |
---|
BasicFreeChoicesHelper(String question) |
Modifier and Type | Method and Description |
---|---|
protected String |
convertKey(String key)
can be overridden to convert input
|
String |
getChoice(String key)
Every implementation should consider that invalid choices lead to null values
that will be simply handled in a while condition
|
String |
getFullMessage() |
String |
getQuestion() |
protected boolean |
isValid(String key)
can be overridden to validate input
|
public BasicFreeChoicesHelper(String question)
public String getQuestion()
public String getFullMessage()
getFullMessage
in interface ChoicesHelper
public String getChoice(String key)
ChoicesHelper
getChoice
in interface ChoicesHelper
protected String convertKey(String key)
key
- protected boolean isValid(String key)
key
- Copyright © 2017. All rights reserved.