Class ChangeData


  • public class ChangeData
    extends Object
    • Method Detail

      • ensureChangeLoaded

        public static void ensureChangeLoaded​(Iterable<ChangeData> changes)
      • ensureAllPatchSetsLoaded

        public static void ensureAllPatchSetsLoaded​(Iterable<ChangeData> changes)
      • ensureCurrentPatchSetLoaded

        public static void ensureCurrentPatchSetLoaded​(Iterable<ChangeData> changes)
      • ensureCurrentApprovalsLoaded

        public static void ensureCurrentApprovalsLoaded​(Iterable<ChangeData> changes)
      • ensureMessagesLoaded

        public static void ensureMessagesLoaded​(Iterable<ChangeData> changes)
      • ensureReviewedByLoadedForOpenChanges

        public static void ensureReviewedByLoadedForOpenChanges​(Iterable<ChangeData> changes)
      • createForTest

        public static ChangeData createForTest​(Project.NameKey project,
                                               Change.Id id,
                                               int currentPatchSetId,
                                               org.eclipse.jgit.lib.ObjectId commitId)
        Create an instance for testing only.

        Attempting to lazy load data will fail with NPEs. Callers may consider manually setting fields that can be set.

        Parameters:
        id - change ID
        Returns:
        instance for testing.
      • setLazyLoad

        public ChangeData setLazyLoad​(boolean load)
        If false, omit fields that require database/repo IO.

        This is used to enforce that the dashboard is rendered from the index only. If lazyLoad is on, the ChangeData object will load from the database ("lazily") when a field accessor is called.

      • getAllUsersNameForIndexing

        public AllUsersName getAllUsersNameForIndexing()
      • setCurrentFilePaths

        public void setCurrentFilePaths​(List<String> filePaths)
      • currentFilePaths

        public List<String> currentFilePaths()
      • setChangedLines

        public void setChangedLines​(int insertions,
                                    int deletions)
      • setNoChangedLines

        public void setNoChangedLines()
      • change

        public Change change()
      • setChange

        public void setChange​(Change c)
      • reloadChange

        public Change reloadChange()
      • getLabelTypes

        public LabelTypes getLabelTypes()
      • currentPatchSet

        public PatchSet currentPatchSet()
      • commitMessage

        public String commitMessage()
      • commitFooters

        public List<org.eclipse.jgit.revwalk.FooterLine> commitFooters()
      • trackingFooters

        public com.google.common.collect.ListMultimap<String,​String> trackingFooters()
      • getAuthor

        public org.eclipse.jgit.lib.PersonIdent getAuthor()
      • getCommitter

        public org.eclipse.jgit.lib.PersonIdent getCommitter()
      • patchSets

        public Collection<PatchSet> patchSets()
        Returns:
        patches for the change, in patch set ID order.
      • patchSet

        public PatchSet patchSet​(PatchSet.Id psId)
        Returns:
        patch with the given ID, or null if it does not exist.
      • approvals

        public com.google.common.collect.ListMultimap<PatchSet.Id,​PatchSetApproval> approvals()
        Returns:
        all patch set approvals for the change, keyed by ID, ordered by timestamp within each patch set.
      • setReviewers

        public void setReviewers​(ReviewerSet reviewers)
      • setReviewersByEmail

        public void setReviewersByEmail​(ReviewerByEmailSet reviewersByEmail)
      • setPendingReviewers

        public void setPendingReviewers​(ReviewerSet pendingReviewers)
      • getPendingReviewers

        public ReviewerSet getPendingReviewers()
      • pendingReviewers

        public ReviewerSet pendingReviewers()
      • setPendingReviewersByEmail

        public void setPendingReviewersByEmail​(ReviewerByEmailSet pendingReviewersByEmail)
      • unresolvedCommentCount

        public Integer unresolvedCommentCount()
      • setUnresolvedCommentCount

        public void setUnresolvedCommentCount​(Integer count)
      • totalCommentCount

        public Integer totalCommentCount()
      • setTotalCommentCount

        public void setTotalCommentCount​(Integer count)
      • setMergeable

        public void setMergeable​(Boolean mergeable)
      • isMergeable

        public Boolean isMergeable()
      • editRefs

        public Map<Account.Id,​org.eclipse.jgit.lib.Ref> editRefs()
      • draftRefs

        public Map<Account.Id,​org.eclipse.jgit.lib.Ref> draftRefs()
      • isReviewedBy

        public boolean isReviewedBy​(Account.Id accountId)
      • setReviewedBy

        public void setReviewedBy​(Set<Account.Id> reviewedBy)
      • setHashtags

        public void setHashtags​(Set<String> hashtags)
      • stars

        public com.google.common.collect.ImmutableListMultimap<Account.Id,​String> stars()
      • setStars

        public void setStars​(com.google.common.collect.ListMultimap<Account.Id,​String> stars)
      • isPureRevert

        public Boolean isPureRevert()
        Returns:
        null if revertOf is null; true if the change is a pure revert; false otherwise.
      • getRefStates

        public com.google.common.collect.ImmutableList<byte[]> getRefStates()
      • setRefStates

        public void setRefStates​(Iterable<byte[]> refStates)
      • getRefStatePatterns

        public com.google.common.collect.ImmutableList<byte[]> getRefStatePatterns()
      • setRefStatePatterns

        public void setRefStatePatterns​(Iterable<byte[]> refStatePatterns)