Package com.google.gerrit.server
Interface ChangeDraftUpdate
- All Known Implementing Classes:
ChangeDraftNotesUpdate
public interface ChangeDraftUpdate
An interface for updating draft comments.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllDraftCommentsForDeletion
(List<Comment> comments) Marks all comments for deletion.void
Marks a comment for deletion.boolean
Whether all updates in this updater can run asynchronously.A unique identifier for the draft, used by the storage system.void
Marks a comment for deletion.void
Creates a draft comment.default <UpdateT extends ChangeDraftUpdate>
Optional<UpdateT>toOptionalChangeDraftUpdateSubtype
(Class<UpdateT> subtype) Converts this update to the given subtype if possible.
-
Method Details
-
putDraftComment
Creates a draft comment. -
markDraftCommentAsPublished
Marks a comment for deletion. Called when the comment is deleted because the user published it.NOTE for implementers: The actual deletion of a published draft should only happen after the published comment is successfully updated. Please use
ChangeDraftUpdateExecutor
. -
addDraftCommentForDeletion
Marks a comment for deletion. Called when the comment is deleted because the user removed it. -
addAllDraftCommentsForDeletion
Marks all comments for deletion. Called when there are inconsistencies between the published comments storage and the drafts one. -
canRunAsync
boolean canRunAsync()Whether all updates in this updater can run asynchronously. -
getStorageKey
String getStorageKey()A unique identifier for the draft, used by the storage system. For example, NoteDB's ref name. -
toOptionalChangeDraftUpdateSubtype
default <UpdateT extends ChangeDraftUpdate> Optional<UpdateT> toOptionalChangeDraftUpdateSubtype(Class<UpdateT> subtype) Converts this update to the given subtype if possible. ReturnsOptional.empty()
otherwise.
-