Interface PromptOptionMatcher<TOption>

Type Parameters:
TOption - Option type
All Known Implementing Classes:
DefaultMatcher, ExactIgnoresCaseMatcher, ExactMatcher, IgnoresCaseMatcher, IndexMatcher, ValueMatcher

public interface PromptOptionMatcher<TOption>
Interfaces for option matchers that controls how options are matched to the prompt response when using Prompt.promptForOption(boolean)
  • Method Summary

    Modifier and Type
    Method
    Description
    match(Prompt<TOption> prompt, String response)
    Matches the response to an option provided by the prompt
  • Method Details

    • match

      TOption match(Prompt<TOption> prompt, String response) throws PromptException
      Matches the response to an option provided by the prompt
      Parameters:
      prompt - Prompt
      response - Response value that has been read from the prompt
      Returns:
      Matched option
      Throws:
      PromptException - Thrown if the response value does not match any option, or if the matcher is not compatible with the prompt