Package com.atlassian.bitbucket.idx
Interface IndexingContext
public interface IndexingContext
Used to by
CommitIndexer
s 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 TypeMethodDescription<T> T
Retrieve an object from the context.com.atlassian.bitbucket.repository.Repository
Sets a key-value pair in the context.Removes a key-value pair from the context.
-
Method Details
-
get
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
Sets a key-value pair in the context. Keys used should be distinctive as the same context is shared across all enabledindexers
for a given repository.- Parameters:
key
- the key to store the value under, which should be uniquevalue
- the value to store- Returns:
- the previous value stored under this key, or
null
if the key is new
-
remove
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
-