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(ChangeAttribute a, ChangeNotes notes)
Add allReviewers to an existing ChangeAttribute.void
addApprovals(PatchSetAttribute p, PatchSet.Id id, Map<PatchSet.Id,Collection<PatchSetApproval>> all, LabelTypes labelTypes)
void
addApprovals(PatchSetAttribute p, Collection<PatchSetApproval> list, LabelTypes labelTypes)
void
addComments(ChangeAttribute ca, Collection<ChangeMessage> messages)
void
addCommitMessage(ChangeAttribute a, String commitMessage)
void
addDependencies(org.eclipse.jgit.revwalk.RevWalk rw, ChangeAttribute ca, Change change, PatchSet currentPs)
void
addPatchSetComments(PatchSetAttribute patchSetAttribute, Collection<Comment> comments)
void
addPatchSetFileNames(PatchSetAttribute patchSetAttribute, Change change, PatchSet patchSet)
void
addPatchSets(org.eclipse.jgit.revwalk.RevWalk revWalk, 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, ChangeAttribute ca, Collection<PatchSet> ps, Map<PatchSet.Id,Collection<PatchSetApproval>> approvals, LabelTypes labelTypes)
void
addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords)
Add submitRecords to an existing ChangeAttribute.void
addTrackingIds(ChangeAttribute a, com.google.common.collect.ListMultimap<String,String> set)
AccountAttribute
asAccountAttribute(Account.Id id)
Create an AuthorAttribute for the given account suitable for serialization to JSON.AccountAttribute
asAccountAttribute(AccountState accountState)
Create an AuthorAttribute for the given account suitable for serialization to JSON.AccountAttribute
asAccountAttribute(org.eclipse.jgit.lib.PersonIdent ident)
Create an AuthorAttribute for the given person ident suitable for serialization to JSON.ApprovalAttribute
asApprovalAttribute(PatchSetApproval approval, LabelTypes labelTypes)
Create an ApprovalAttribute for the given approval suitable for serialization to JSON.ChangeAttribute
asChangeAttribute(Change change)
Create a ChangeAttribute for the given change suitable for serialization to JSON.ChangeAttribute
asChangeAttribute(Change change, ChangeNotes notes)
Create a ChangeAttribute for the given change suitable for serialization to JSON.MessageAttribute
asMessageAttribute(ChangeMessage message)
PatchSetAttribute
asPatchSetAttribute(org.eclipse.jgit.revwalk.RevWalk revWalk, Change change, PatchSet patchSet)
Create a PatchSetAttribute for the given patchset suitable for serialization to JSON.PatchSetCommentAttribute
asPatchSetLineAttribute(Comment c)
RefUpdateAttribute
asRefUpdateAttribute(org.eclipse.jgit.lib.ObjectId oldId, org.eclipse.jgit.lib.ObjectId newId, BranchNameKey refName)
Create a RefUpdateAttribute for the given old ObjectId, new ObjectId, and branch that is suitable for serialization to JSON.void
extend(ChangeAttribute a, Change change)
Extend the existing ChangeAttribute with additional fields.
-
-
-
Method Detail
-
asChangeAttribute
public ChangeAttribute asChangeAttribute(Change change)
Create a ChangeAttribute for the given change suitable for serialization to JSON.- Parameters:
change
-- Returns:
- object suitable for serialization to JSON
-
asChangeAttribute
public ChangeAttribute asChangeAttribute(Change change, ChangeNotes notes)
Create a ChangeAttribute for the given change suitable for serialization to JSON.- Parameters:
change
-notes
-- Returns:
- object suitable for serialization to JSON
-
asRefUpdateAttribute
public RefUpdateAttribute asRefUpdateAttribute(org.eclipse.jgit.lib.ObjectId oldId, org.eclipse.jgit.lib.ObjectId newId, BranchNameKey refName)
Create a RefUpdateAttribute for the given old ObjectId, new ObjectId, and branch that is suitable for serialization to JSON.- Parameters:
oldId
-newId
-refName
-- Returns:
- object suitable for serialization to JSON
-
extend
public void extend(ChangeAttribute a, Change change)
Extend the existing ChangeAttribute with additional fields.- Parameters:
a
-change
-
-
addAllReviewers
public void addAllReviewers(ChangeAttribute a, ChangeNotes notes)
Add allReviewers to an existing ChangeAttribute.- Parameters:
a
-notes
-
-
addSubmitRecords
public void addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords)
Add submitRecords to an existing ChangeAttribute.- Parameters:
ca
-submitRecords
-
-
addDependencies
public void addDependencies(org.eclipse.jgit.revwalk.RevWalk rw, ChangeAttribute ca, Change change, PatchSet currentPs)
-
addTrackingIds
public void addTrackingIds(ChangeAttribute a, com.google.common.collect.ListMultimap<String,String> set)
-
addCommitMessage
public void addCommitMessage(ChangeAttribute a, String commitMessage)
-
addPatchSets
public void addPatchSets(org.eclipse.jgit.revwalk.RevWalk revWalk, ChangeAttribute ca, Collection<PatchSet> ps, Map<PatchSet.Id,Collection<PatchSetApproval>> approvals, LabelTypes labelTypes)
-
addPatchSets
public void addPatchSets(org.eclipse.jgit.revwalk.RevWalk revWalk, ChangeAttribute ca, Collection<PatchSet> ps, Map<PatchSet.Id,Collection<PatchSetApproval>> approvals, boolean includeFiles, Change change, LabelTypes labelTypes)
-
addPatchSetComments
public void addPatchSetComments(PatchSetAttribute patchSetAttribute, Collection<Comment> comments)
-
addPatchSetFileNames
public void addPatchSetFileNames(PatchSetAttribute patchSetAttribute, Change change, PatchSet patchSet)
-
addComments
public void addComments(ChangeAttribute ca, Collection<ChangeMessage> messages)
-
asPatchSetAttribute
public PatchSetAttribute asPatchSetAttribute(org.eclipse.jgit.revwalk.RevWalk revWalk, Change change, PatchSet patchSet)
Create a PatchSetAttribute for the given patchset suitable for serialization to JSON.- Parameters:
patchSet
-- Returns:
- object suitable for serialization to JSON
-
addApprovals
public void addApprovals(PatchSetAttribute p, PatchSet.Id id, Map<PatchSet.Id,Collection<PatchSetApproval>> all, LabelTypes labelTypes)
-
addApprovals
public void addApprovals(PatchSetAttribute p, Collection<PatchSetApproval> list, LabelTypes labelTypes)
-
asAccountAttribute
public AccountAttribute asAccountAttribute(Account.Id id)
Create an AuthorAttribute for the given account suitable for serialization to JSON.- Parameters:
id
-- Returns:
- object suitable for serialization to JSON
-
asAccountAttribute
public AccountAttribute asAccountAttribute(AccountState accountState)
Create an AuthorAttribute for the given account suitable for serialization to JSON.- Parameters:
accountState
- the account state- Returns:
- object suitable for serialization to JSON
-
asAccountAttribute
public AccountAttribute asAccountAttribute(org.eclipse.jgit.lib.PersonIdent ident)
Create an AuthorAttribute for the given person ident suitable for serialization to JSON.- Parameters:
ident
-- Returns:
- object suitable for serialization to JSON
-
asApprovalAttribute
public ApprovalAttribute asApprovalAttribute(PatchSetApproval approval, LabelTypes labelTypes)
Create an ApprovalAttribute for the given approval suitable for serialization to JSON.- Parameters:
approval
-labelTypes
- label types for the containing project- Returns:
- object suitable for serialization to JSON
-
asMessageAttribute
public MessageAttribute asMessageAttribute(ChangeMessage message)
-
asPatchSetLineAttribute
public PatchSetCommentAttribute asPatchSetLineAttribute(Comment c)
-
-