Package com.google.gerrit.server.notedb
Class DraftCommentsNotesReader
java.lang.Object
com.google.gerrit.server.notedb.DraftCommentsNotesReader
- All Implemented Interfaces:
DraftCommentsReader
-
Method Summary
Modifier and TypeMethodDescriptiongetChangesWithDrafts
(Account.Id author) Returns all changes that contain draft comments ofauthor
.getDraftComment
(ChangeNotes notes, IdentifiedUser author, Comment.Key key) Returns a single draft of the provided change, that was written byauthor
and has the givenkey
, orOptional::empty
if there is no such comment.getDraftsByChangeAndDraftAuthor
(Change.Id changeId, Account.Id author) Returns all drafts of the provided change, that were written byauthor
.getDraftsByChangeAndDraftAuthor
(ChangeNotes notes, Account.Id author) Returns all drafts of the provided change, that were written byauthor
.Returns all drafts of the provided change, regardless of the author.getDraftsByPatchSetAndDraftAuthor
(ChangeNotes notes, PatchSet.Id psId, Account.Id author) Returns all drafts of the provided patch set, that were written byauthor
.getUsersWithDrafts
(ChangeNotes changeNotes) Returns all users that have any draft comments on the provided change.
-
Method Details
-
getDraftComment
public Optional<HumanComment> getDraftComment(ChangeNotes notes, IdentifiedUser author, Comment.Key key) Description copied from interface:DraftCommentsReader
Returns a single draft of the provided change, that was written byauthor
and has the givenkey
, orOptional::empty
if there is no such comment.- Specified by:
getDraftComment
in interfaceDraftCommentsReader
-
getDraftsByChangeAndDraftAuthor
Description copied from interface:DraftCommentsReader
Returns all drafts of the provided change, that were written byauthor
. The comments are sorted byCommentsUtil.COMMENT_ORDER
.- Specified by:
getDraftsByChangeAndDraftAuthor
in interfaceDraftCommentsReader
-
getDraftsByChangeAndDraftAuthor
Description copied from interface:DraftCommentsReader
Returns all drafts of the provided change, that were written byauthor
. The comments are sorted byCommentsUtil.COMMENT_ORDER
.If you already have a ChangeNotes instance, consider using
DraftCommentsReader.getDraftsByChangeAndDraftAuthor(ChangeNotes, Account.Id)
instead.- Specified by:
getDraftsByChangeAndDraftAuthor
in interfaceDraftCommentsReader
-
getDraftsByPatchSetAndDraftAuthor
public List<HumanComment> getDraftsByPatchSetAndDraftAuthor(ChangeNotes notes, PatchSet.Id psId, Account.Id author) Description copied from interface:DraftCommentsReader
Returns all drafts of the provided patch set, that were written byauthor
. The comments are sorted byCommentsUtil.COMMENT_ORDER
.- Specified by:
getDraftsByPatchSetAndDraftAuthor
in interfaceDraftCommentsReader
-
getDraftsByChangeForAllAuthors
Description copied from interface:DraftCommentsReader
Returns all drafts of the provided change, regardless of the author. The comments are sorted byCommentsUtil.COMMENT_ORDER
.- Specified by:
getDraftsByChangeForAllAuthors
in interfaceDraftCommentsReader
-
getUsersWithDrafts
Description copied from interface:DraftCommentsReader
Returns all users that have any draft comments on the provided change.- Specified by:
getUsersWithDrafts
in interfaceDraftCommentsReader
-
getChangesWithDrafts
Description copied from interface:DraftCommentsReader
Returns all changes that contain draft comments ofauthor
.- Specified by:
getChangesWithDrafts
in interfaceDraftCommentsReader
-