Class IndexMatcher<TOption>
java.lang.Object
com.github.rvesse.airline.prompts.matchers.IndexMatcher<TOption>
- Type Parameters:
TOption
- Option type
- All Implemented Interfaces:
PromptOptionMatcher<TOption>
An option matcher that matches options based on the numeric index of the option using 1 based indexes
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
IndexMatcher
public IndexMatcher()
-
-
Method Details
-
match
Description copied from interface:PromptOptionMatcher
Matches the response to an option provided by the prompt- Specified by:
match
in interfacePromptOptionMatcher<TOption>
- Parameters:
prompt
- Promptresponse
- 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
-