Class Comment

java.lang.Object
com.google.gerrit.entities.Comment
Direct Known Subclasses:
HumanComment, RobotComment

public abstract class Comment extends Object
This class is a base class that can be extended by the different types of inline comment entities.

Changing fields in this class changes the storage format of inline comments in NoteDb and may require a corresponding data migration (adding new optional fields is generally okay).

Consider updating getCommentFieldApproximateSize() when adding/changing fields.

  • Field Details

  • Constructor Details

  • Method Details

    • setWrittenOn

      public void setWrittenOn(Instant writtenOn)
    • setLineNbrAndRange

      public void setLineNbrAndRange(Integer lineNbr, Comment.Range range)
    • setRange

      public void setRange(CommentRange range)
    • getCommitId

      public org.eclipse.jgit.lib.ObjectId getCommitId()
    • setCommitId

      public void setCommitId(org.eclipse.jgit.lib.AnyObjectId commitId)
    • setRealAuthor

      public void setRealAuthor(Account.Id id)
    • getRealAuthor

      public Comment.Identity getRealAuthor()
    • getCommentFieldApproximateSize

      protected int getCommentFieldApproximateSize()
      Returns the comment's approximate size. This is used to enforce size limits and should therefore include all unbounded fields (e.g. String-s).
    • getApproximateSize

      public int getApproximateSize()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringHelper

      protected com.google.common.base.MoreObjects.ToStringHelper toStringHelper()