Class ChangeData
- java.lang.Object
-
- com.google.gerrit.server.query.change.ChangeData
-
public class ChangeData extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ChangeData.AssistedFactory
static class
ChangeData.ChangedLines
static class
ChangeData.Factory
-
Method Summary
-
-
-
Method Detail
-
asChanges
public static List<Change> asChanges(List<ChangeData> changeDatas) throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
asMap
public static Map<Change.Id,ChangeData> asMap(List<ChangeData> changes)
-
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)
-
db
public ReviewDb db()
-
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
-
changedLines
public Optional<ChangeData.ChangedLines> changedLines() throws com.google.gwtorm.server.OrmException, IOException
- Throws:
com.google.gwtorm.server.OrmException
IOException
-
setChangedLines
public void setChangedLines(int insertions, int deletions)
-
setNoChangedLines
public void setNoChangedLines()
-
getId
public Change.Id getId()
-
project
public Project.NameKey project()
-
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
-
setCurrentApprovals
public void setCurrentApprovals(List<PatchSetApproval> approvals)
-
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.
-
setPatchSets
public void setPatchSets(Collection<PatchSet> patchSets)
-
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)
-
getReviewers
public ReviewerSet getReviewers()
-
reviewersByEmail
public ReviewerByEmailSet reviewersByEmail() throws com.google.gwtorm.server.OrmException
- Throws:
com.google.gwtorm.server.OrmException
-
setReviewersByEmail
public void setReviewersByEmail(ReviewerByEmailSet reviewersByEmail)
-
getReviewersByEmail
public ReviewerByEmailSet getReviewersByEmail()
-
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)
-
getPendingReviewersByEmail
public ReviewerByEmailSet getPendingReviewersByEmail()
-
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
-
setReviewerUpdates
public void setReviewerUpdates(List<ReviewerStatusUpdate> reviewerUpdates)
-
getReviewerUpdates
public List<ReviewerStatusUpdate> getReviewerUpdates()
-
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
-
getLatestComment
protected Comment getLatestComment(Map<String,List<Comment>> forest, Comment root)
-
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
-
getSubmitRecords
public List<SubmitRecord> getSubmitRecords(SubmitRuleOptions options)
-
setSubmitRecords
public void setSubmitRecords(SubmitRuleOptions options, List<SubmitRecord> records)
-
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
-
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
ifrevertOf
isnull
; 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)
-
-