public interface

IndexingContext

com.atlassian.bitbucket.idx.IndexingContext

Class Overview

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.

Summary

Public Methods
@Nullable <T> T get(String key)
Retrieve an object from the context.
@Nonnull Repository getRepository()
@Nullable Object put(String key, Object value)
Sets a key-value pair in the context.
@Nullable Object remove(String key)
Removes a key-value pair from the context.

Public Methods

@Nullable public T get (String key)

Retrieve an object from the context.

Parameters
key the key to lookup
Returns
  • the value, or null if not present in the context

@Nonnull public Repository getRepository ()

Returns
  • the repository that is being indexed

@Nullable public Object put (String key, 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

@Nullable public Object remove (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