T
- the type of value for the choice, usually Integer or Stringpublic class Choice<T>
extends java.lang.Object
implements java.io.Serializable
ChoiceAnswerFormat
.
They typically have an integer or string value, always with a string text representation of the
choice for the user.Constructor and Description |
---|
Choice(java.lang.String text,
T value)
Creates a choice object with the provided text and value, detailtext is null
|
Choice(java.lang.String text,
T value,
java.lang.String detailText)
Creates a choice object with the provided text, value, and detailtext
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDetailText()
Gets the detail text for this choice, or null
|
java.lang.String |
getText()
Return the user-facing text for this choice
|
T |
getValue()
Returns the value of type T for this choice
|
void |
setDetailText(java.lang.String detailText)
Sets the (optional) detail text for this choice
|
void |
setText(java.lang.String text)
Sets the text that the user will see for this choice
|
void |
setValue(T value)
Sets the value of type T for this choice
|
public Choice(java.lang.String text, T value)
text
- user-facing text representing the choicevalue
- value of any type for this choice, type should match other choices in the steppublic Choice(java.lang.String text, T value, java.lang.String detailText)
text
- user-facing text representing the choicevalue
- value of any type for this choice, type should match other choices in the
stepdetailText
- extra detail text for the choicepublic java.lang.String getText()
public void setText(java.lang.String text)
text
- the textpublic T getValue()
public void setValue(T value)
value
- the value of this choicepublic java.lang.String getDetailText()
public void setDetailText(java.lang.String detailText)
detailText
- the detail text