public class CommentsUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static com.google.common.collect.Ordering<CommentInfo> |
COMMENT_INFO_ORDER |
static com.google.common.collect.Ordering<Comment> |
COMMENT_ORDER |
Modifier and Type | Method and Description |
---|---|
java.util.List<Comment> |
byPatchSet(ChangeNotes notes,
PatchSet.Id psId) |
void |
deleteCommentByRewritingHistory(ChangeUpdate update,
Comment.Key commentKey,
java.lang.String newMessage) |
void |
deleteComments(ChangeUpdate update,
java.lang.Iterable<Comment> comments) |
java.util.List<Comment> |
draftByChange(ChangeNotes notes) |
java.util.List<Comment> |
draftByChangeAuthor(ChangeNotes notes,
Account.Id author) |
java.util.List<Comment> |
draftByChangeFileAuthor(ChangeNotes notes,
java.lang.String file,
Account.Id author) |
java.util.List<Comment> |
draftByPatchSetAuthor(PatchSet.Id psId,
Account.Id author,
ChangeNotes notes) |
static java.lang.String |
extractMessageId(java.lang.String tag) |
static PatchSet.Id |
getCommentPsId(Change.Id changeId,
Comment comment) |
java.util.Optional<Comment> |
getDraft(ChangeNotes notes,
IdentifiedUser user,
Comment.Key key) |
java.util.Collection<org.eclipse.jgit.lib.Ref> |
getDraftRefs(Change.Id changeId)
Get NoteDb draft refs for a change.
|
java.util.Optional<Comment> |
getPublished(ChangeNotes notes,
Comment.Key key) |
Comment |
newComment(ChangeContext ctx,
java.lang.String path,
PatchSet.Id psId,
short side,
java.lang.String message,
java.lang.Boolean unresolved,
java.lang.String parentUuid) |
RobotComment |
newRobotComment(ChangeContext ctx,
java.lang.String path,
PatchSet.Id psId,
short side,
java.lang.String message,
java.lang.String robotId,
java.lang.String robotRunId) |
java.util.List<Comment> |
publishedByChange(ChangeNotes notes) |
java.util.List<Comment> |
publishedByChangeFile(ChangeNotes notes,
java.lang.String file) |
java.util.List<Comment> |
publishedByPatchSet(ChangeNotes notes,
PatchSet.Id psId) |
void |
putComments(ChangeUpdate update,
PatchLineComment.Status status,
java.lang.Iterable<Comment> comments) |
void |
putRobotComments(ChangeUpdate update,
java.lang.Iterable<RobotComment> comments) |
java.util.List<RobotComment> |
robotCommentsByChange(ChangeNotes notes) |
java.util.List<RobotComment> |
robotCommentsByPatchSet(ChangeNotes notes,
PatchSet.Id psId) |
static void |
setCommentRevId(Comment c,
PatchListCache cache,
Change change,
PatchSet ps) |
static java.util.List<Comment> |
toComments(java.lang.String serverId,
java.lang.Iterable<PatchLineComment> comments) |
static java.lang.Iterable<PatchLineComment> |
toPatchLineComments(Change.Id changeId,
PatchLineComment.Status status,
java.lang.Iterable<Comment> comments) |
public static final com.google.common.collect.Ordering<Comment> COMMENT_ORDER
public static final com.google.common.collect.Ordering<CommentInfo> COMMENT_INFO_ORDER
public static PatchSet.Id getCommentPsId(Change.Id changeId, Comment comment)
public static java.lang.String extractMessageId(java.lang.String tag)
public Comment newComment(ChangeContext ctx, java.lang.String path, PatchSet.Id psId, short side, java.lang.String message, java.lang.Boolean unresolved, java.lang.String parentUuid) throws UnprocessableEntityException
UnprocessableEntityException
public RobotComment newRobotComment(ChangeContext ctx, java.lang.String path, PatchSet.Id psId, short side, java.lang.String message, java.lang.String robotId, java.lang.String robotRunId)
public java.util.Optional<Comment> getPublished(ChangeNotes notes, Comment.Key key)
public java.util.Optional<Comment> getDraft(ChangeNotes notes, IdentifiedUser user, Comment.Key key)
public java.util.List<Comment> publishedByChange(ChangeNotes notes)
public java.util.List<RobotComment> robotCommentsByChange(ChangeNotes notes)
public java.util.List<Comment> draftByChange(ChangeNotes notes)
public java.util.List<Comment> byPatchSet(ChangeNotes notes, PatchSet.Id psId)
public java.util.List<Comment> publishedByChangeFile(ChangeNotes notes, java.lang.String file)
public java.util.List<Comment> publishedByPatchSet(ChangeNotes notes, PatchSet.Id psId)
public java.util.List<RobotComment> robotCommentsByPatchSet(ChangeNotes notes, PatchSet.Id psId)
public java.util.List<Comment> draftByPatchSetAuthor(PatchSet.Id psId, Account.Id author, ChangeNotes notes)
public java.util.List<Comment> draftByChangeFileAuthor(ChangeNotes notes, java.lang.String file, Account.Id author)
public java.util.List<Comment> draftByChangeAuthor(ChangeNotes notes, Account.Id author)
public void putComments(ChangeUpdate update, PatchLineComment.Status status, java.lang.Iterable<Comment> comments)
public void putRobotComments(ChangeUpdate update, java.lang.Iterable<RobotComment> comments)
public void deleteComments(ChangeUpdate update, java.lang.Iterable<Comment> comments)
public void deleteCommentByRewritingHistory(ChangeUpdate update, Comment.Key commentKey, java.lang.String newMessage)
public static void setCommentRevId(Comment c, PatchListCache cache, Change change, PatchSet ps) throws PatchListNotAvailableException
PatchListNotAvailableException
public java.util.Collection<org.eclipse.jgit.lib.Ref> getDraftRefs(Change.Id changeId)
Works if NoteDb is not enabled, but the results are not meaningful.
This is just a simple ref scan, so the results may potentially include refs for zombie draft comments. A zombie draft is one which has been published but the write to delete the draft ref from All-Users failed.
changeId
- change ID.public static java.lang.Iterable<PatchLineComment> toPatchLineComments(Change.Id changeId, PatchLineComment.Status status, java.lang.Iterable<Comment> comments)
public static java.util.List<Comment> toComments(java.lang.String serverId, java.lang.Iterable<PatchLineComment> comments)