Package com.google.gerrit.server.comment
Class CommentContextCacheImpl
java.lang.Object
com.google.gerrit.server.comment.CommentContextCacheImpl
- All Implemented Interfaces:
CommentContextCache
Implementation of
CommentContextCache.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intComment context is expected to contain just few lines of code to be displayed beside the comment. -
Method Summary
Modifier and TypeMethodDescriptionget(CommentContextKey comment) Returns the context lines for a single comment.com.google.common.collect.ImmutableMap<CommentContextKey,CommentContext> getAll(Iterable<CommentContextKey> inputKeys) Returns the context lines for multiple comments - identified by theirkeys.static com.google.inject.Modulemodule()
-
Field Details
-
MAX_CONTEXT_PADDING
public static final int MAX_CONTEXT_PADDINGComment context is expected to contain just few lines of code to be displayed beside the comment. Setting an upper bound of 100 for padding.- See Also:
-
-
Method Details
-
module
public static com.google.inject.Module module() -
get
Description copied from interface:CommentContextCacheReturns the context lines for a single comment. Works for published and draft comments.- Specified by:
getin interfaceCommentContextCache- Parameters:
comment- a key representing a subset of fields for a comment that serves as an identifier.- Returns:
- a
CommentContextobject containing all line numbers and text of the context.
-
getAll
public com.google.common.collect.ImmutableMap<CommentContextKey,CommentContext> getAll(Iterable<CommentContextKey> inputKeys) Description copied from interface:CommentContextCacheReturns the context lines for multiple comments - identified by theirkeys. Works for published and draft comments.- Specified by:
getAllin interfaceCommentContextCache- Parameters:
inputKeys- list of keys, where each key represents a single comment through its project, change ID, patchset, path and ID. The keys can belong to different projects and changes.- Returns:
MapofCommentContextcontaining the context for all comments.
-