Class CommentContextCacheImpl

java.lang.Object
com.google.gerrit.server.comment.CommentContextCacheImpl
All Implemented Interfaces:
CommentContextCache

public class CommentContextCacheImpl extends Object implements CommentContextCache
Implementation of CommentContextCache.
  • Field Details

    • 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:
  • Method Details

    • 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 interface CommentContextCache
      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 their keys. Works for published and draft comments.
      Specified by:
      getAll in interface CommentContextCache
      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 of CommentContext containing the context for all comments.