- java.lang.Object
-
- org.jline.prompt.impl.DefaultChoiceItem
-
- All Implemented Interfaces:
ChoiceItem,PromptItem
public class DefaultChoiceItem extends java.lang.Object implements ChoiceItem
Default implementation of ChoiceItem interface.
-
-
Constructor Summary
Constructors Constructor Description DefaultChoiceItem(java.lang.String name, java.lang.String text, char key)DefaultChoiceItem(java.lang.String name, java.lang.String text, char key, java.lang.String helpText, boolean defaultChoice)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHelpText()java.lang.CharactergetKey()Get the key associated with this choice.java.lang.StringgetName()Get the name of this item.java.lang.StringgetText()Get the text to display for this item.booleanisDefaultChoice()Whether this choice is the default choice.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jline.prompt.PromptItem
getDisabledText, getFooter, isDisabled, isSelectable
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:PromptItemGet the name of this item.- Specified by:
getNamein interfacePromptItem- Returns:
- the name
-
getText
public java.lang.String getText()
Description copied from interface:PromptItemGet the text to display for this item.- Specified by:
getTextin interfacePromptItem- Returns:
- the text
-
getKey
public java.lang.Character getKey()
Description copied from interface:ChoiceItemGet the key associated with this choice.- Specified by:
getKeyin interfaceChoiceItem- Returns:
- the key
-
getHelpText
public java.lang.String getHelpText()
-
isDefaultChoice
public boolean isDefaultChoice()
Description copied from interface:ChoiceItemWhether this choice is the default choice.- Specified by:
isDefaultChoicein interfaceChoiceItem- Returns:
- true if this choice is the default
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-