Class EventFactory

java.lang.Object
com.google.gerrit.server.events.EventFactory

public class EventFactory extends Object
  • Method Details

    • 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)
    • 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, AccountAttributeLoader accountLoader)
    • 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, AccountAttributeLoader accountLoader)
    • addPatchSetComments

      public void addPatchSetComments(com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute, Collection<HumanComment> comments, AccountAttributeLoader accountLoader)
    • 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, AccountAttributeLoader accountLoader)
    • 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.
    • addApprovals

      public void addApprovals(com.google.gerrit.server.data.PatchSetAttribute p, PatchSet.Id id, Map<PatchSet.Id,Collection<PatchSetApproval>> all, LabelTypes labelTypes, AccountAttributeLoader accountLoader)
    • addApprovals

      public void addApprovals(com.google.gerrit.server.data.PatchSetAttribute p, Collection<PatchSetApproval> list, LabelTypes labelTypes, AccountAttributeLoader accountLoader)
    • asAccountAttribute

      public com.google.gerrit.server.data.AccountAttribute asAccountAttribute(Account.Id id, AccountAttributeLoader accountLoader)
    • 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
    • asMessageAttribute

      public com.google.gerrit.server.data.MessageAttribute asMessageAttribute(ChangeMessage message, AccountAttributeLoader accountLoader)
    • asPatchSetLineAttribute

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