Class EventFactory


  • public class EventFactory
    extends Object
    • Method Detail

      • asChangeAttribute

        public com.google.gerrit.server.data.ChangeAttribute asChangeAttribute​(Change change,
                                                                               AccountAttributeLoader accountLoader)
      • asChangeAttribute

        public com.google.gerrit.server.data.ChangeAttribute asChangeAttribute​(Change change,
                                                                               ChangeNotes notes)
        Create a ChangeAttribute 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 a RefUpdateAttribute 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 existing ChangeAttribute with additional fields.
      • addAllReviewers

        public void addAllReviewers​(com.google.gerrit.server.data.ChangeAttribute a,
                                    ChangeNotes notes,
                                    AccountAttributeLoader accountLoader)
        Add allReviewers to an existing ChangeAttribute.
      • addSubmitRecords

        public void addSubmitRecords​(com.google.gerrit.server.data.ChangeAttribute ca,
                                     List<SubmitRecord> submitRecords,
                                     AccountAttributeLoader accountLoader)
        Add submitRecords to an existing ChangeAttribute.
      • 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)
      • addPatchSetFileNames

        public void addPatchSetFileNames​(com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute,
                                         Change change,
                                         PatchSet patchSet)
      • asPatchSetAttribute

        public com.google.gerrit.server.data.PatchSetAttribute asPatchSetAttribute​(org.eclipse.jgit.revwalk.RevWalk revWalk,
                                                                                   Change change,
                                                                                   PatchSet patchSet)
      • asPatchSetAttribute

        public com.google.gerrit.server.data.PatchSetAttribute asPatchSetAttribute​(org.eclipse.jgit.revwalk.RevWalk revWalk,
                                                                                   Change change,
                                                                                   PatchSet patchSet,
                                                                                   AccountAttributeLoader accountLoader)
        Create a PatchSetAttribute for the given patchset suitable for serialization to JSON.
      • 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,
                                                                                   AccountAttributeLoader accountLoader)
        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
      • asPatchSetLineAttribute

        public com.google.gerrit.server.data.PatchSetCommentAttribute asPatchSetLineAttribute​(HumanComment c,
                                                                                              AccountAttributeLoader accountLoader)