public class CommentsUtil extends 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 |
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 Comment newComment(ChangeContext ctx, String path, PatchSet.Id psId, short side, String message, Boolean unresolved, String parentUuid) throws UnprocessableEntityException
UnprocessableEntityException
public RobotComment newRobotComment(ChangeContext ctx, String path, PatchSet.Id psId, short side, String message, String robotId, String robotRunId)
public Optional<Comment> getPublished(ChangeNotes notes, Comment.Key key)
public Optional<Comment> getDraft(ChangeNotes notes, IdentifiedUser user, Comment.Key key)
public List<Comment> publishedByChange(ChangeNotes notes)
public List<RobotComment> robotCommentsByChange(ChangeNotes notes)
public List<Comment> draftByChange(ChangeNotes notes)
public List<Comment> byPatchSet(ChangeNotes notes, PatchSet.Id psId)
public List<Comment> publishedByChangeFile(ChangeNotes notes, String file)
public List<Comment> publishedByPatchSet(ChangeNotes notes, PatchSet.Id psId)
public List<RobotComment> robotCommentsByPatchSet(ChangeNotes notes, PatchSet.Id psId)
public List<Comment> draftByPatchSetAuthor(PatchSet.Id psId, Account.Id author, ChangeNotes notes)
public List<Comment> draftByChangeFileAuthor(ChangeNotes notes, String file, Account.Id author)
public List<Comment> draftByChangeAuthor(ChangeNotes notes, Account.Id author)
public void putComments(ChangeUpdate update, PatchLineComment.Status status, Iterable<Comment> comments)
public void putRobotComments(ChangeUpdate update, Iterable<RobotComment> comments)
public void deleteComments(ChangeUpdate update, Iterable<Comment> comments)
public void deleteCommentByRewritingHistory(ChangeUpdate update, Comment.Key commentKey, String newMessage)
public static void setCommentRevId(Comment c, PatchListCache cache, Change change, PatchSet ps) throws PatchListNotAvailableException
PatchListNotAvailableException
public 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 Iterable<PatchLineComment> toPatchLineComments(Change.Id changeId, PatchLineComment.Status status, Iterable<Comment> comments)
public static List<Comment> toComments(String serverId, Iterable<PatchLineComment> comments)