Package com.google.gerrit.entities
Class Comment
java.lang.Object
com.google.gerrit.entities.Comment
- Direct Known Subclasses:
HumanComment
,RobotComment
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
static final class
The Range class defines continuous range of character.static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
The line number (1-based) to which the comment refers, or 0 for a file comment.protected Comment.Identity
short
-
Constructor Summary
ConstructorsConstructorDescriptionComment
(Comment.Key key, Account.Id author, Instant writtenOn, short side, String message, String serverId) -
Method Summary
Modifier and TypeMethodDescriptionboolean
abstract int
protected int
Returns the comment's approximate size.org.eclipse.jgit.lib.ObjectId
int
hashCode()
void
setCommitId
(org.eclipse.jgit.lib.AnyObjectId commitId) void
setLineNbrAndRange
(Integer lineNbr, Comment.Range range) void
setRange
(CommentRange range) void
void
setWrittenOn
(Instant writtenOn) toString()
protected com.google.common.base.MoreObjects.ToStringHelper
-
Field Details
-
key
-
lineNbr
public int lineNbrThe line number (1-based) to which the comment refers, or 0 for a file comment. -
author
-
realAuthor
-
writtenOn
-
side
public short side -
message
-
parentUuid
-
range
-
tag
-
serverId
-
-
Constructor Details
-
Comment
-
Comment
public Comment(Comment.Key key, Account.Id author, Instant writtenOn, short side, String message, String serverId)
-
-
Method Details
-
setWrittenOn
-
setLineNbrAndRange
-
setRange
-
getCommitId
public org.eclipse.jgit.lib.ObjectId getCommitId() -
setCommitId
public void setCommitId(org.eclipse.jgit.lib.AnyObjectId commitId) -
setRealAuthor
-
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 abstract int getApproximateSize() -
equals
-
hashCode
public int hashCode() -
toString
-
toStringHelper
protected com.google.common.base.MoreObjects.ToStringHelper toStringHelper()
-