Class EventFactory


  • public class EventFactory
    extends Object
    • 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)
      • 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
      • 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