Interface Indexer<ApiType>

All Superinterfaces:
Store<ApiType>
All Known Implementing Classes:
Cache

public interface Indexer<ApiType> extends Store<ApiType>
Indexer extends Store interface and adds index/de-index methods.
  • Method Details

    • index

      List<ApiType> index(String indexName, ApiType obj)
      Retrieve list of objects that match on the named indexing function.
      Parameters:
      indexName - specific indexing function
      Returns:
      matched objects
    • indexKeys

      List<String> indexKeys(String indexName, String indexKey)
      IndexKeys returns the set of keys that match on the named indexing function.
      Parameters:
      indexName - specific indexing function
      indexKey - specific index key
      Returns:
      matched keys
    • byIndex

      List<ApiType> byIndex(String indexName, String indexKey)
      ByIndex lists object that match on the named indexing function with the exact key.
      Parameters:
      indexName - specific indexing function
      indexKey - specific index key
      Returns:
      matched objects
    • getIndexers

      Map<String,Function<ApiType,List<String>>> getIndexers()
      Return the indexers registered with the store.
      Returns:
      registered indexers
    • addIndexers

      void addIndexers(Map<String,Function<ApiType,List<String>>> indexers)
      Add additional indexers to the store.
      Parameters:
      indexers - indexers to add