Interface IndexingContext


public interface IndexingContext
Used to by CommitIndexers to store state during the indexing process. A new context will be used for each indexing run, but for each run the same context will be shared by all enabled indexers.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    get(String key)
    Retrieve an object from the context.
    com.atlassian.bitbucket.repository.Repository
     
    put(String key, Object value)
    Sets a key-value pair in the context.
    Removes a key-value pair from the context.
  • Method Details

    • get

      @Nullable <T> T get(@Nullable String key)
      Retrieve an object from the context.
      Type Parameters:
      T - the type of object expected at the specified key
      Parameters:
      key - the key to lookup
      Returns:
      the value, or null if not present in the context
    • getRepository

      @Nonnull com.atlassian.bitbucket.repository.Repository getRepository()
      Returns:
      the repository that is being indexed
    • put

      @Nullable Object put(@Nullable String key, @Nullable Object value)
      Sets a key-value pair in the context. Keys used should be distinctive as the same context is shared across all enabled indexers for a given repository.
      Parameters:
      key - the key to store the value under, which should be unique
      value - the value to store
      Returns:
      the previous value stored under this key, or null if the key is new
    • remove

      @Nullable Object remove(@Nullable String key)
      Removes a key-value pair from the context.
      Parameters:
      key - the key to remove
      Returns:
      the value that was removed, or null if the key was not in the context