- java.lang.Object
-
- org.jline.prompt.impl.AbstractPromptResult<EditorPrompt>
-
- org.jline.prompt.impl.DefaultEditorResult
-
- All Implemented Interfaces:
EditorResult,PromptResult<EditorPrompt>
public class DefaultEditorResult extends AbstractPromptResult<EditorPrompt> implements EditorResult
Implementation of EditorResult.
-
-
Constructor Summary
Constructors Constructor Description DefaultEditorResult(java.lang.String text, EditorPrompt prompt)Create a new DefaultEditorResult with the given text.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDisplayResult()Get a human-readable display representation of the result.protected java.lang.StringgetRawResult()Get the raw (unfiltered) result value.java.lang.StringgetText()Get the edited text content.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
getPrompt, getResult
-
-
-
-
Constructor Detail
-
DefaultEditorResult
public DefaultEditorResult(java.lang.String text, EditorPrompt prompt)Create a new DefaultEditorResult with the given text.- Parameters:
text- the edited text contentprompt- the associated EditorPrompt
-
-
Method Detail
-
getText
public java.lang.String getText()
Description copied from interface:EditorResultGet the edited text content.- Specified by:
getTextin interfaceEditorResult- Returns:
- the edited text
-
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<EditorPrompt>- Returns:
- the raw result value
-
getDisplayResult
public java.lang.String getDisplayResult()
Description copied from interface:PromptResultGet a human-readable display representation of the result.This method returns a formatted version of the result that is suitable for display to users. It may differ from
PromptResult.getResult()by providing more descriptive text or better formatting.The default implementation returns the same value as
PromptResult.getResult(). Specific result types may override this to provide more user-friendly formatting.- Specified by:
getDisplayResultin interfacePromptResult<EditorPrompt>- Returns:
- a display-friendly representation of the result, never
null
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-