Package com.google.gerrit.server.comment
Class CommentContextCacheImpl
- java.lang.Object
-
- com.google.gerrit.server.comment.CommentContextCacheImpl
-
- All Implemented Interfaces:
CommentContextCache
public class CommentContextCacheImpl extends Object implements CommentContextCache
Implementation ofCommentContextCache.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommentContextCacheImpl.CommentContextSerializer
-
Field Summary
Fields Modifier and Type Field Description static intMAX_CONTEXT_PADDINGComment context is expected to contain just few lines of code to be displayed beside the comment.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CommentContextget(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 Detail
-
MAX_CONTEXT_PADDING
public static final int MAX_CONTEXT_PADDING
Comment 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:
- Constant Field Values
-
-
Method Detail
-
module
public static com.google.inject.Module module()
-
get
public CommentContext get(CommentContextKey comment)
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.
-
-