Package com.google.gerrit.server.events
Class EventFactory
- java.lang.Object
-
- com.google.gerrit.server.events.EventFactory
-
public class EventFactory extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllReviewers(com.google.gerrit.server.data.ChangeAttribute a, ChangeNotes notes)
Add allReviewers to an existingChangeAttribute
.void
addApprovals(com.google.gerrit.server.data.PatchSetAttribute p, PatchSet.Id id, Map<PatchSet.Id,Collection<PatchSetApproval>> all, LabelTypes labelTypes)
void
addApprovals(com.google.gerrit.server.data.PatchSetAttribute p, Collection<PatchSetApproval> list, LabelTypes labelTypes)
void
addComments(com.google.gerrit.server.data.ChangeAttribute ca, Collection<ChangeMessage> messages)
void
addCommitMessage(com.google.gerrit.server.data.ChangeAttribute a, String commitMessage)
void
addDependencies(org.eclipse.jgit.revwalk.RevWalk rw, com.google.gerrit.server.data.ChangeAttribute ca, Change change, PatchSet currentPs)
void
addPatchSetComments(com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute, Collection<HumanComment> comments)
void
addPatchSetFileNames(com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute, Change change, PatchSet patchSet)
void
addPatchSets(org.eclipse.jgit.revwalk.RevWalk revWalk, com.google.gerrit.server.data.ChangeAttribute ca, Collection<PatchSet> ps, Map<PatchSet.Id,Collection<PatchSetApproval>> approvals, boolean includeFiles, Change change, LabelTypes labelTypes)
void
addPatchSets(org.eclipse.jgit.revwalk.RevWalk revWalk, com.google.gerrit.server.data.ChangeAttribute ca, Collection<PatchSet> ps, Map<PatchSet.Id,Collection<PatchSetApproval>> approvals, LabelTypes labelTypes)
void
addSubmitRecords(com.google.gerrit.server.data.ChangeAttribute ca, List<SubmitRecord> submitRecords)
Add submitRecords to an existingChangeAttribute
.void
addTrackingIds(com.google.gerrit.server.data.ChangeAttribute a, com.google.common.collect.ListMultimap<String,String> set)
com.google.gerrit.server.data.AccountAttribute
asAccountAttribute(Account.Id id)
Create an AuthorAttribute for the given account suitable for serialization to JSON.com.google.gerrit.server.data.AccountAttribute
asAccountAttribute(AccountState accountState)
Create an AuthorAttribute for the given account suitable for serialization to JSON.com.google.gerrit.server.data.AccountAttribute
asAccountAttribute(org.eclipse.jgit.lib.PersonIdent ident)
Create an AuthorAttribute for the given person ident suitable for serialization to JSON.com.google.gerrit.server.data.ApprovalAttribute
asApprovalAttribute(PatchSetApproval approval, LabelTypes labelTypes)
Create an ApprovalAttribute for the given approval suitable for serialization to JSON.com.google.gerrit.server.data.ChangeAttribute
asChangeAttribute(Change change)
com.google.gerrit.server.data.ChangeAttribute
asChangeAttribute(Change change, ChangeNotes notes)
Create aChangeAttribute
instance from the specified change.com.google.gerrit.server.data.MessageAttribute
asMessageAttribute(ChangeMessage message)
com.google.gerrit.server.data.PatchSetAttribute
asPatchSetAttribute(org.eclipse.jgit.revwalk.RevWalk revWalk, Change change, PatchSet patchSet)
Create a PatchSetAttribute for the given patchset suitable for serialization to JSON.com.google.gerrit.server.data.PatchSetCommentAttribute
asPatchSetLineAttribute(HumanComment c)
com.google.gerrit.server.data.RefUpdateAttribute
asRefUpdateAttribute(org.eclipse.jgit.lib.ObjectId oldId, org.eclipse.jgit.lib.ObjectId newId, BranchNameKey refName)
Create aRefUpdateAttribute
for the given old ObjectId, new ObjectId, and branch that is suitable for serialization to JSON.void
extend(com.google.gerrit.server.data.ChangeAttribute a, Change change)
Extend the existingChangeAttribute
with additional fields.
-
-
-
Method Detail
-
asChangeAttribute
public com.google.gerrit.server.data.ChangeAttribute asChangeAttribute(Change change)
-
asChangeAttribute
public com.google.gerrit.server.data.ChangeAttribute asChangeAttribute(Change change, ChangeNotes notes)
Create aChangeAttribute
instance from the specified change.
-
asRefUpdateAttribute
public com.google.gerrit.server.data.RefUpdateAttribute asRefUpdateAttribute(org.eclipse.jgit.lib.ObjectId oldId, org.eclipse.jgit.lib.ObjectId newId, BranchNameKey refName)
Create aRefUpdateAttribute
for the given old ObjectId, new ObjectId, and branch that is suitable for serialization to JSON.
-
extend
public void extend(com.google.gerrit.server.data.ChangeAttribute a, Change change)
Extend the existingChangeAttribute
with additional fields.
-
addAllReviewers
public void addAllReviewers(com.google.gerrit.server.data.ChangeAttribute a, ChangeNotes notes)
Add allReviewers to an existingChangeAttribute
.
-
addSubmitRecords
public void addSubmitRecords(com.google.gerrit.server.data.ChangeAttribute ca, List<SubmitRecord> submitRecords)
Add submitRecords to an existingChangeAttribute
.
-
addDependencies
public void addDependencies(org.eclipse.jgit.revwalk.RevWalk rw, com.google.gerrit.server.data.ChangeAttribute ca, Change change, PatchSet currentPs)
-
addTrackingIds
public void addTrackingIds(com.google.gerrit.server.data.ChangeAttribute a, com.google.common.collect.ListMultimap<String,String> set)
-
addCommitMessage
public void addCommitMessage(com.google.gerrit.server.data.ChangeAttribute a, String commitMessage)
-
addPatchSets
public void addPatchSets(org.eclipse.jgit.revwalk.RevWalk revWalk, com.google.gerrit.server.data.ChangeAttribute ca, Collection<PatchSet> ps, Map<PatchSet.Id,Collection<PatchSetApproval>> approvals, LabelTypes labelTypes)
-
addPatchSets
public void addPatchSets(org.eclipse.jgit.revwalk.RevWalk revWalk, com.google.gerrit.server.data.ChangeAttribute ca, Collection<PatchSet> ps, Map<PatchSet.Id,Collection<PatchSetApproval>> approvals, boolean includeFiles, Change change, LabelTypes labelTypes)
-
addPatchSetComments
public void addPatchSetComments(com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute, Collection<HumanComment> comments)
-
addPatchSetFileNames
public void addPatchSetFileNames(com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute, Change change, PatchSet patchSet)
-
addComments
public void addComments(com.google.gerrit.server.data.ChangeAttribute ca, Collection<ChangeMessage> messages)
-
asPatchSetAttribute
public com.google.gerrit.server.data.PatchSetAttribute asPatchSetAttribute(org.eclipse.jgit.revwalk.RevWalk revWalk, Change change, PatchSet patchSet)
Create a PatchSetAttribute for the given patchset suitable for serialization to JSON.
-
addApprovals
public void addApprovals(com.google.gerrit.server.data.PatchSetAttribute p, PatchSet.Id id, Map<PatchSet.Id,Collection<PatchSetApproval>> all, LabelTypes labelTypes)
-
addApprovals
public void addApprovals(com.google.gerrit.server.data.PatchSetAttribute p, Collection<PatchSetApproval> list, LabelTypes labelTypes)
-
asAccountAttribute
public com.google.gerrit.server.data.AccountAttribute asAccountAttribute(Account.Id id)
Create an AuthorAttribute for the given account suitable for serialization to JSON.
-
asAccountAttribute
public com.google.gerrit.server.data.AccountAttribute asAccountAttribute(AccountState accountState)
Create an AuthorAttribute for the given account suitable for serialization to JSON.
-
asAccountAttribute
public com.google.gerrit.server.data.AccountAttribute asAccountAttribute(org.eclipse.jgit.lib.PersonIdent ident)
Create an AuthorAttribute for the given person ident suitable for serialization to JSON.
-
asApprovalAttribute
public com.google.gerrit.server.data.ApprovalAttribute asApprovalAttribute(PatchSetApproval approval, LabelTypes labelTypes)
Create an ApprovalAttribute for the given approval suitable for serialization to JSON.- Parameters:
labelTypes
- label types for the containing project- Returns:
- object suitable for serialization to JSON
-
asMessageAttribute
public com.google.gerrit.server.data.MessageAttribute asMessageAttribute(ChangeMessage message)
-
asPatchSetLineAttribute
public com.google.gerrit.server.data.PatchSetCommentAttribute asPatchSetLineAttribute(HumanComment c)
-
-