Class DefaultMatcher<TOption>

  • Type Parameters:
    TOption - Option type
    All Implemented Interfaces:
    PromptOptionMatcher<TOption>
    Direct Known Subclasses:
    ExactMatcher, IgnoresCaseMatcher

    public class DefaultMatcher<TOption>
    extends Object
    implements PromptOptionMatcher<TOption>
    Default prompt option matcher

    This matcher tries to find the most likely options using either exact matching or partial matching. It also allows for numeric option selection when the prompt has enabled that feature.

    • Constructor Detail

      • DefaultMatcher

        public DefaultMatcher()
    • Method Detail

      • getExactMatcher

        protected org.apache.commons.collections4.Predicate<TOption> getExactMatcher​(String response)
        Gets an exact matcher
        Parameters:
        response - User response to match options against
        Returns:
        Exact matcher
      • getExactOrPartialMatcher

        protected org.apache.commons.collections4.Predicate<TOption> getExactOrPartialMatcher​(String response)
        Gets an exact or partial matcher
        Parameters:
        response - User response to match options against
        Returns:
        Exact or partial matcher