MetaDone
|
Public Member Functions | |
Question (String message, boolean requiresUser, Class< T > cl) | |
Question (String message, boolean requiresUser, Class< T > cl, T defaultOption) | |
Question (String message, boolean requiresUser, Class< T > cl, List<?extends T > options, T defaultOption) | |
final String | getMessage () |
final boolean | requiresUserInteraction () |
final Class< T > | getType () |
final List< T > | getOptions () |
String[] | getOptionsStrings () |
T | getSelected () |
void | setSelected (T selected) |
String | toString () |
Static Public Member Functions | |
static Question< Boolean > | confirm (String message, boolean def) |
Private Attributes | |
final String | message |
final boolean | requiresUserInteraction |
final Class< T > | type |
final List< T > | options |
T | selected |
A question to answer automatically or by the user.
<T> | The type fo th response |
metadone.metabusiness.events.Question< T >.Question | ( | String | message, |
boolean | requiresUser, | ||
Class< T > | cl | ||
) |
Initializes this question.
message | The message |
requiresUser | Whether the question requires the user to answer |
cl | The class |
NullPointerException | when message or cl is null |
metadone.metabusiness.events.Question< T >.Question | ( | String | message, |
boolean | requiresUser, | ||
Class< T > | cl, | ||
T | defaultOption | ||
) |
Initializes this question.
message | The message |
requiresUser | Whether the question requires the user to answer |
cl | The class |
defaultOption | The default answer |
NullPointerException | when message or cl is null |
metadone.metabusiness.events.Question< T >.Question | ( | String | message, |
boolean | requiresUser, | ||
Class< T > | cl, | ||
List<?extends T > | options, | ||
T | defaultOption | ||
) |
Initializes this question.
message | The message |
requiresUser | Whether the question requires the user to answer |
cl | The class |
options | The different answers |
defaultOption | The default answer |
NullPointerException | when message or cl is null |
static Question<Boolean> metadone.metabusiness.events.Question< T >.confirm | ( | String | message, |
boolean | def | ||
) | [static] |
Creates a confirmation question.
message | The message |
def | The default choice |
final String metadone.metabusiness.events.Question< T >.getMessage | ( | ) |
Gets the message.
final List<T> metadone.metabusiness.events.Question< T >.getOptions | ( | ) |
Gets the list of options.
The list is empty if there is no restriction.
String [] metadone.metabusiness.events.Question< T >.getOptionsStrings | ( | ) |
Gets the options as strings.
This can be used for presentation purposes.
T metadone.metabusiness.events.Question< T >.getSelected | ( | ) |
Gets the selected answer.
final Class<T> metadone.metabusiness.events.Question< T >.getType | ( | ) |
Gets the type.
final boolean metadone.metabusiness.events.Question< T >.requiresUserInteraction | ( | ) |
Indicates whether user interaction is required.
void metadone.metabusiness.events.Question< T >.setSelected | ( | T | selected | ) |
Sets the answer.
selected | The answer |
IllegalArgumentException | when the answer does not have a valid type or is not one of the options |
String metadone.metabusiness.events.Question< T >.toString | ( | ) |
References metadone.util.Objects.equal().
final String metadone.metabusiness.events.Question< T >.message [private] |
final List<T> metadone.metabusiness.events.Question< T >.options [private] |
final boolean metadone.metabusiness.events.Question< T >.requiresUserInteraction [private] |
T metadone.metabusiness.events.Question< T >.selected [private] |
final Class<T> metadone.metabusiness.events.Question< T >.type [private] |