Package com.google.gerrit.server.notedb
Class RobotCommentUpdate
- java.lang.Object
-
- com.google.gerrit.server.notedb.AbstractChangeUpdate
-
- com.google.gerrit.server.notedb.RobotCommentUpdate
-
public class RobotCommentUpdate extends AbstractChangeUpdate
A single delta to apply atomically to a change.This delta contains only robot comments on a single patch set of a change by a single author. This delta will become a single commit in the repository.
This class is not thread safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRobotCommentUpdate.Factory
-
Field Summary
-
Fields inherited from class com.google.gerrit.server.notedb.AbstractChangeUpdate
accountId, authorIdent, NO_OP_UPDATE, noteUtil, psId, realAccountId, rootOnly, serverIdent, when
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.jgit.lib.CommitBuilderapplyImpl(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectInserter ins, org.eclipse.jgit.lib.ObjectId curr)Create a commit containing the contents of this update.protected Project.NameKeygetProjectName()protected StringgetRefName()booleanisEmpty()Whether no updates have been done.voidputComment(RobotComment c)-
Methods inherited from class com.google.gerrit.server.notedb.AbstractChangeUpdate
allowWriteToNewRef, bypassMaxUpdates, getAccountId, getChange, getId, getNotes, getNullableAccountId, getPatchSetId, getWhen, isRootOnly, newIdent, setPatchSetId, verifyComment
-
-
-
-
Method Detail
-
putComment
public void putComment(RobotComment c)
-
applyImpl
protected org.eclipse.jgit.lib.CommitBuilder applyImpl(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectInserter ins, org.eclipse.jgit.lib.ObjectId curr) throws IOExceptionDescription copied from class:AbstractChangeUpdateCreate a commit containing the contents of this update.- Specified by:
applyImplin classAbstractChangeUpdateins- inserter to write to; callers should not flush.- Returns:
- a new commit builder representing this commit, or null to indicate the meta ref should
be deleted as a result of this update. The parent, author, and committer fields in the
return value are always overwritten. The tree ID may be unset by this method, which
indicates to the caller that it should be copied from the parent commit. To indicate that
this update is a no-op (but this could not be determined by
AbstractChangeUpdate.isEmpty()), return the sentinelAbstractChangeUpdate.NO_OP_UPDATE. - Throws:
IOException- if a lower-level error occurred.
-
getProjectName
protected Project.NameKey getProjectName()
- Specified by:
getProjectNamein classAbstractChangeUpdate- Returns:
- the NameKey for the project where the update will be stored, which is not necessarily the same as the change's project.
-
getRefName
protected String getRefName()
- Specified by:
getRefNamein classAbstractChangeUpdate
-
isEmpty
public boolean isEmpty()
Description copied from class:AbstractChangeUpdateWhether no updates have been done.- Specified by:
isEmptyin classAbstractChangeUpdate
-
-