Class SearchIndex<T>

java.lang.Object
org.naviqore.utils.search.SearchIndex<T>
Type Parameters:
T - the type of objects to be indexed.

public class SearchIndex<T> extends Object
SearchIndex class for indexing strings and their associated objects.

Supports different search strategies on strings, such as STARTS_WITH, ENDS_WITH, CONTAINS, and EXACT.

  • Constructor Details

    • SearchIndex

      public SearchIndex()
  • Method Details

    • builder

      public static <T> SearchIndexBuilder<T> builder()
    • search

      public Set<T> search(String query, SearchIndex.SearchStrategy strategy)
      Searches for values matching the query and the search strategy.
      Parameters:
      query - the string query to search for.
      strategy - the search strategy to use.
      Returns:
      the values associated with the query if found, otherwise an empty list.