- java.lang.Object
-
- org.jline.prompt.impl.AbstractPromptResult<ChoicePrompt>
-
- org.jline.prompt.impl.DefaultChoiceResult
-
- All Implemented Interfaces:
ChoiceResult,PromptResult<ChoicePrompt>
public class DefaultChoiceResult extends AbstractPromptResult<ChoicePrompt> implements ChoiceResult
Implementation of ChoiceResult.
-
-
Constructor Summary
Constructors Constructor Description DefaultChoiceResult(java.lang.String selectedId, ChoicePrompt prompt)Create a new DefaultChoiceResult with the given selected ID and item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetRawResult()Get the raw (unfiltered) result value.java.lang.StringgetSelectedId()Get the ID of the selected item.java.lang.StringtoString()-
Methods inherited from class org.jline.prompt.impl.AbstractPromptResult
applyFilter, getPrompt, getResult
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jline.prompt.PromptResult
getDisplayResult, getPrompt, getResult
-
-
-
-
Constructor Detail
-
DefaultChoiceResult
public DefaultChoiceResult(java.lang.String selectedId, ChoicePrompt prompt)Create a new DefaultChoiceResult with the given selected ID and item.- Parameters:
selectedId- the ID of the selected itemitem- the associated PromptItem, or null if none
-
-
Method Detail
-
getSelectedId
public java.lang.String getSelectedId()
Description copied from interface:ChoiceResultGet the ID of the selected item.- Specified by:
getSelectedIdin interfaceChoiceResult- Returns:
- the ID of the selected item
-
getRawResult
protected java.lang.String getRawResult()
Description copied from class:AbstractPromptResultGet the raw (unfiltered) result value. Subclasses must implement this instead ofAbstractPromptResult.getResult().- Specified by:
getRawResultin classAbstractPromptResult<ChoicePrompt>- Returns:
- the raw result value
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-