public static < T extends Searcher > T createSearcherElseDefault ( final SearchType type , final T defaultSearcher ) { try { return createSearcher ( type ) ; } catch ( IllegalArgumentException ignore ) { return defaultSearcher ; } }
Creates an instance of the Searcher interface implementing the searching algorithm based on the SearchType otherwise returns the provided default Searcher implementation if a Searcher based on the specified SearchType is not available .