- java.lang.Object
-
- org.jline.prompt.impl.AbstractPromptResult<TogglePrompt>
-
- org.jline.prompt.impl.DefaultToggleResult
-
- All Implemented Interfaces:
PromptResult<TogglePrompt>,ToggleResult
public class DefaultToggleResult extends AbstractPromptResult<TogglePrompt> implements ToggleResult
Implementation of ToggleResult.
-
-
Constructor Summary
Constructors Constructor Description DefaultToggleResult(boolean active, TogglePrompt prompt)
-
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.booleanisActive()Get the selected value.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
-
DefaultToggleResult
public DefaultToggleResult(boolean active, TogglePrompt prompt)
-
-
Method Detail
-
isActive
public boolean isActive()
Description copied from interface:ToggleResultGet the selected value.- Specified by:
isActivein interfaceToggleResult- Returns:
- true if active state was selected, false for inactive
-
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<TogglePrompt>- 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<TogglePrompt>- Returns:
- a display-friendly representation of the result, never
null
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-