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 class
CommentContextCacheImpl.CommentContextSerializer
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_CONTEXT_PADDING
Comment 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 CommentContext
get(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.Module
module()
-
-
-
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:CommentContextCache
Returns the context lines for a single comment. Works for published and draft comments.- Specified by:
get
in interfaceCommentContextCache
- Parameters:
comment
- a key representing a subset of fields for a comment that serves as an identifier.- Returns:
- a
CommentContext
object 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:CommentContextCache
Returns the context lines for multiple comments - identified by theirkeys
. Works for published and draft comments.- Specified by:
getAll
in 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:
Map
ofCommentContext
containing the context for all comments.
-
-