public class BasicFreeChoicesHelper extends Object implements ChoicesHelper
ChoicesHelper based on a free entry with possible check and conversion| Constructor 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 ChoicesHelperpublic String getChoice(String key)
ChoicesHelpergetChoice in interface ChoicesHelperprotected String convertKey(String key)
key - protected boolean isValid(String key)
key - Copyright © 2018. All rights reserved.