Class SearchIndexBuilder<T>

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

public class SearchIndexBuilder<T> extends Object
Builder class for creating a SearchIndex with key-value pairs.
  • Constructor Details

    • SearchIndexBuilder

      public SearchIndexBuilder()
  • Method Details

    • add

      public SearchIndexBuilder<T> add(String key, T value)
      Adds a key-value pair to the builder.
      Parameters:
      key - the string key to be indexed.
      value - the value associated with the key.
      Returns:
      the builder instance.
    • build

      public SearchIndex<T> build()
      Builds the SearchIndex by compressing the underlying Trie.
      Returns:
      the built and compressed SearchIndex.