public class Comment
extends java.lang.Object
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).
PatchLineComment
also represents inline comments, but in ReviewDb. There are a few
notable differences:
For all utility classes and middle layer functionality using Comment over PatchLineComment is preferred, as PatchLineComment will go away together with ReviewDb. This means Comment should be used everywhere and only for storing inline comment in ReviewDb a conversion to PatchLineComment is done. Converting Comments to PatchLineComments and vice verse is done by CommentsUtil#toPatchLineComments(Change.Id, PatchLineComment.Status, Iterable) and CommentsUtil#toComments(String, Iterable).
Modifier and Type | Class and Description |
---|---|
static class |
Comment.Identity |
static class |
Comment.Key |
static class |
Comment.Range |
Modifier and Type | Field and Description |
---|---|
Comment.Identity |
author |
Comment.Key |
key |
boolean |
legacyFormat
Whether the comment was parsed from a JSON representation (false) or the legacy custom notes
format (true).
|
int |
lineNbr |
java.lang.String |
message |
java.lang.String |
parentUuid |
Comment.Range |
range |
protected Comment.Identity |
realAuthor |
java.lang.String |
revId |
java.lang.String |
serverId |
short |
side |
java.lang.String |
tag |
boolean |
unresolved |
java.sql.Timestamp |
writtenOn |
Constructor and Description |
---|
Comment(Comment.Key key,
Account.Id author,
java.sql.Timestamp writtenOn,
short side,
java.lang.String message,
java.lang.String serverId,
boolean unresolved) |
Comment(Comment c) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
Comment.Identity |
getRealAuthor() |
int |
hashCode() |
void |
setLineNbrAndRange(java.lang.Integer lineNbr,
Comment.Range range) |
void |
setRange(CommentRange range) |
void |
setRealAuthor(Account.Id id) |
void |
setRevId(RevId revId) |
java.lang.String |
toString() |
public Comment.Key key
public int lineNbr
public Comment.Identity author
protected Comment.Identity realAuthor
public java.sql.Timestamp writtenOn
public short side
public java.lang.String message
public java.lang.String parentUuid
public Comment.Range range
public java.lang.String tag
public java.lang.String revId
public java.lang.String serverId
public boolean unresolved
public transient boolean legacyFormat
public Comment(Comment c)
public Comment(Comment.Key key, Account.Id author, java.sql.Timestamp writtenOn, short side, java.lang.String message, java.lang.String serverId, boolean unresolved)
public void setLineNbrAndRange(java.lang.Integer lineNbr, Comment.Range range)
public void setRange(CommentRange range)
public void setRevId(RevId revId)
public void setRealAuthor(Account.Id id)
public Comment.Identity getRealAuthor()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object