MetaDone
metadone.metabusiness.events.Question< T > Class Reference
Collaboration diagram for metadone.metabusiness.events.Question< T >:

List of all members.

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 ()
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
selected

Detailed Description

A question to answer automatically or by the user.

Author:
kma
Parameters:
<T>The type fo th response

Constructor & Destructor Documentation

metadone.metabusiness.events.Question< T >.Question ( String  message,
boolean  requiresUser,
Class< T >  cl 
)

Initializes this question.

Parameters:
messageThe message
requiresUserWhether the question requires the user to answer
clThe class
Exceptions:
NullPointerExceptionwhen message or cl is null
metadone.metabusiness.events.Question< T >.Question ( String  message,
boolean  requiresUser,
Class< T >  cl,
defaultOption 
)

Initializes this question.

Parameters:
messageThe message
requiresUserWhether the question requires the user to answer
clThe class
defaultOptionThe default answer
Exceptions:
NullPointerExceptionwhen message or cl is null
metadone.metabusiness.events.Question< T >.Question ( String  message,
boolean  requiresUser,
Class< T >  cl,
List<?extends T >  options,
defaultOption 
)

Initializes this question.

Parameters:
messageThe message
requiresUserWhether the question requires the user to answer
clThe class
optionsThe different answers
defaultOptionThe default answer
Exceptions:
NullPointerExceptionwhen message or cl is null

Member Function Documentation

static Question<Boolean> metadone.metabusiness.events.Question< T >.confirm ( String  message,
boolean  def 
) [static]

Creates a confirmation question.

Parameters:
messageThe message
defThe default choice
Returns:
The question
final String metadone.metabusiness.events.Question< T >.getMessage ( )

Gets the message.

Returns:
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.

Returns:
The list of options
String [] metadone.metabusiness.events.Question< T >.getOptionsStrings ( )

Gets the options as strings.

This can be used for presentation purposes.

Returns:
The array of options as strings
T metadone.metabusiness.events.Question< T >.getSelected ( )

Gets the selected answer.

Returns:
The answer
final Class<T> metadone.metabusiness.events.Question< T >.getType ( )

Gets the type.

Returns:
The class
final boolean metadone.metabusiness.events.Question< T >.requiresUserInteraction ( )

Indicates whether user interaction is required.

Returns:
Whether user interaction is required
void metadone.metabusiness.events.Question< T >.setSelected ( selected)

Sets the answer.

Parameters:
selectedThe answer
Exceptions:
IllegalArgumentExceptionwhen the answer does not have a valid type or is not one of the options
String metadone.metabusiness.events.Question< T >.toString ( )

Member Data Documentation

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]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations