Class ChangeData


  • public class ChangeData
    extends Object
    • Method Detail

      • asChanges

        public static List<Change> asChanges​(List<ChangeData> changeDatas)
                                      throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • ensureChangeLoaded

        public static void ensureChangeLoaded​(Iterable<ChangeData> changes)
                                       throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • ensureAllPatchSetsLoaded

        public static void ensureAllPatchSetsLoaded​(Iterable<ChangeData> changes)
                                             throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • ensureCurrentPatchSetLoaded

        public static void ensureCurrentPatchSetLoaded​(Iterable<ChangeData> changes)
                                                throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • ensureCurrentApprovalsLoaded

        public static void ensureCurrentApprovalsLoaded​(Iterable<ChangeData> changes)
                                                 throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • ensureMessagesLoaded

        public static void ensureMessagesLoaded​(Iterable<ChangeData> changes)
                                         throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • ensureReviewedByLoadedForOpenChanges

        public static void ensureReviewedByLoadedForOpenChanges​(Iterable<ChangeData> changes)
                                                         throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • createForTest

        public static ChangeData createForTest​(Project.NameKey project,
                                               Change.Id id,
                                               int currentPatchSetId)
        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)
      • getAllUsersNameForIndexing

        public AllUsersName getAllUsersNameForIndexing()
      • setCurrentFilePaths

        public void setCurrentFilePaths​(List<String> filePaths)
                                 throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • currentFilePaths

        public List<String> currentFilePaths()
                                      throws IOException,
                                             com.google.gwtorm.server.OrmException
        Throws:
        IOException
        com.google.gwtorm.server.OrmException
      • setChangedLines

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

        public void setNoChangedLines()
      • change

        public Change change()
                      throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • setChange

        public void setChange​(Change c)
      • reloadChange

        public Change reloadChange()
                            throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • getLabelTypes

        public LabelTypes getLabelTypes()
                                 throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • notes

        public ChangeNotes notes()
                          throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • currentPatchSet

        public PatchSet currentPatchSet()
                                 throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • currentApprovals

        public List<PatchSetApproval> currentApprovals()
                                                throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • commitMessage

        public String commitMessage()
                             throws IOException,
                                    com.google.gwtorm.server.OrmException
        Throws:
        IOException
        com.google.gwtorm.server.OrmException
      • commitFooters

        public List<org.eclipse.jgit.revwalk.FooterLine> commitFooters()
                                                                throws IOException,
                                                                       com.google.gwtorm.server.OrmException
        Throws:
        IOException
        com.google.gwtorm.server.OrmException
      • trackingFooters

        public com.google.common.collect.ListMultimap<String,​String> trackingFooters()
                                                                                    throws IOException,
                                                                                           com.google.gwtorm.server.OrmException
        Throws:
        IOException
        com.google.gwtorm.server.OrmException
      • getAuthor

        public org.eclipse.jgit.lib.PersonIdent getAuthor()
                                                   throws IOException,
                                                          com.google.gwtorm.server.OrmException
        Throws:
        IOException
        com.google.gwtorm.server.OrmException
      • getCommitter

        public org.eclipse.jgit.lib.PersonIdent getCommitter()
                                                      throws IOException,
                                                             com.google.gwtorm.server.OrmException
        Throws:
        IOException
        com.google.gwtorm.server.OrmException
      • patchSets

        public Collection<PatchSet> patchSets()
                                       throws com.google.gwtorm.server.OrmException
        Returns:
        patches for the change, in patch set ID order.
        Throws:
        com.google.gwtorm.server.OrmException - an error occurred reading the database.
      • patchSet

        public PatchSet patchSet​(PatchSet.Id psId)
                          throws com.google.gwtorm.server.OrmException
        Returns:
        patch with the given ID, or null if it does not exist.
        Throws:
        com.google.gwtorm.server.OrmException - an error occurred reading the database.
      • approvals

        public com.google.common.collect.ListMultimap<PatchSet.Id,​PatchSetApproval> approvals()
                                                                                             throws com.google.gwtorm.server.OrmException
        Returns:
        all patch set approvals for the change, keyed by ID, ordered by timestamp within each patch set.
        Throws:
        com.google.gwtorm.server.OrmException - an error occurred reading the database.
      • getSubmitApproval

        public Optional<PatchSetApproval> getSubmitApproval()
                                                     throws com.google.gwtorm.server.OrmException
        Returns:
        The submit ('SUBM') approval label
        Throws:
        com.google.gwtorm.server.OrmException - an error occurred reading the database.
      • reviewers

        public ReviewerSet reviewers()
                              throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • setReviewers

        public void setReviewers​(ReviewerSet reviewers)
      • reviewersByEmail

        public ReviewerByEmailSet reviewersByEmail()
                                            throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • setReviewersByEmail

        public void setReviewersByEmail​(ReviewerByEmailSet reviewersByEmail)
      • setPendingReviewers

        public void setPendingReviewers​(ReviewerSet pendingReviewers)
      • getPendingReviewers

        public ReviewerSet getPendingReviewers()
      • pendingReviewers

        public ReviewerSet pendingReviewers()
                                     throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • setPendingReviewersByEmail

        public void setPendingReviewersByEmail​(ReviewerByEmailSet pendingReviewersByEmail)
      • pendingReviewersByEmail

        public ReviewerByEmailSet pendingReviewersByEmail()
                                                   throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • reviewerUpdates

        public List<ReviewerStatusUpdate> reviewerUpdates()
                                                   throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • publishedComments

        public Collection<Comment> publishedComments()
                                              throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • robotComments

        public Collection<RobotComment> robotComments()
                                               throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • unresolvedCommentCount

        public Integer unresolvedCommentCount()
                                       throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • setUnresolvedCommentCount

        public void setUnresolvedCommentCount​(Integer count)
      • messages

        public List<ChangeMessage> messages()
                                     throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • submitRecords

        public List<SubmitRecord> submitRecords​(SubmitRuleOptions options)
                                         throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • submitTypeRecord

        public SubmitTypeRecord submitTypeRecord()
                                          throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • setMergeable

        public void setMergeable​(Boolean mergeable)
      • isMergeable

        public Boolean isMergeable()
                            throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • editsByUser

        public Set<Account.Id> editsByUser()
                                    throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • editRefs

        public Map<Account.Id,​org.eclipse.jgit.lib.Ref> editRefs()
                                                                throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • draftsByUser

        public Set<Account.Id> draftsByUser()
                                     throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • draftRefs

        public Map<Account.Id,​org.eclipse.jgit.lib.Ref> draftRefs()
                                                                 throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • isReviewedBy

        public boolean isReviewedBy​(Account.Id accountId)
                             throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • reviewedBy

        public Set<Account.Id> reviewedBy()
                                   throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • setReviewedBy

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

        public Set<String> hashtags()
                             throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • setHashtags

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

        public com.google.common.collect.ImmutableListMultimap<Account.Id,​String> stars()
                                                                                       throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • setStars

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

        public com.google.common.collect.ImmutableMap<Account.Id,​StarredChangesUtil.StarRef> starRefs()
                                                                                                     throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • stars

        public Set<String> stars​(Account.Id accountId)
                          throws com.google.gwtorm.server.OrmException
        Throws:
        com.google.gwtorm.server.OrmException
      • isPureRevert

        public Boolean isPureRevert()
                             throws com.google.gwtorm.server.OrmException
        Returns:
        null if revertOf is null; true if the change is a pure revert; false otherwise.
        Throws:
        com.google.gwtorm.server.OrmException
      • 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)