Class DefaultSearchResult<T>

    • Constructor Detail

      • DefaultSearchResult

        public DefaultSearchResult​(java.lang.String selectedValue,
                                   SearchPrompt<T> prompt)
        Create a new DefaultSearchResult with the given selected value.
        Parameters:
        selectedValue - the selected value as a string
        prompt - the associated SearchPrompt
    • Method Detail

      • getSelectedValue

        public java.lang.String getSelectedValue()
        Description copied from interface: SearchResult
        Get the selected value as a string.
        Specified by:
        getSelectedValue in interface SearchResult<T>
        Returns:
        the selected value
      • getDisplayResult

        public java.lang.String getDisplayResult()
        Description copied from interface: PromptResult
        Get 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:
        getDisplayResult in interface PromptResult<T>
        Returns:
        a display-friendly representation of the result, never null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object