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)
-
asMap
public static Map<Change.Id,ChangeData> asMap(List<ChangeData> changes)
-
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, theChangeData
object will load from the database ("lazily") when a field accessor is called.
-
getAllUsersNameForIndexing
public AllUsersName getAllUsersNameForIndexing()
-
changedLines
public Optional<ChangeData.ChangedLines> changedLines()
-
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()
-
setChange
public void setChange(Change c)
-
reloadChange
public Change reloadChange()
-
getLabelTypes
public LabelTypes getLabelTypes()
-
notes
public ChangeNotes notes()
-
currentPatchSet
public PatchSet currentPatchSet()
-
currentApprovals
public List<PatchSetApproval> currentApprovals()
-
setCurrentApprovals
public void setCurrentApprovals(List<PatchSetApproval> approvals)
-
commitMessage
public String commitMessage()
-
commitFooters
public List<org.eclipse.jgit.revwalk.FooterLine> commitFooters()
-
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.
-
setPatchSets
public void setPatchSets(Collection<PatchSet> patchSets)
-
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.
-
getSubmitApproval
public Optional<PatchSetApproval> getSubmitApproval()
- Returns:
- The submit ('SUBM') approval label
-
reviewers
public ReviewerSet reviewers()
-
setReviewers
public void setReviewers(ReviewerSet reviewers)
-
getReviewers
public ReviewerSet getReviewers()
-
reviewersByEmail
public ReviewerByEmailSet reviewersByEmail()
-
setReviewersByEmail
public void setReviewersByEmail(ReviewerByEmailSet reviewersByEmail)
-
getReviewersByEmail
public ReviewerByEmailSet getReviewersByEmail()
-
setPendingReviewers
public void setPendingReviewers(ReviewerSet pendingReviewers)
-
getPendingReviewers
public ReviewerSet getPendingReviewers()
-
pendingReviewers
public ReviewerSet pendingReviewers()
-
setPendingReviewersByEmail
public void setPendingReviewersByEmail(ReviewerByEmailSet pendingReviewersByEmail)
-
getPendingReviewersByEmail
public ReviewerByEmailSet getPendingReviewersByEmail()
-
pendingReviewersByEmail
public ReviewerByEmailSet pendingReviewersByEmail()
-
reviewerUpdates
public List<ReviewerStatusUpdate> reviewerUpdates()
-
setReviewerUpdates
public void setReviewerUpdates(List<ReviewerStatusUpdate> reviewerUpdates)
-
getReviewerUpdates
public List<ReviewerStatusUpdate> getReviewerUpdates()
-
publishedComments
public Collection<Comment> publishedComments()
-
robotComments
public Collection<RobotComment> robotComments()
-
unresolvedCommentCount
public Integer unresolvedCommentCount()
-
getLatestComment
protected Comment getLatestComment(Map<String,List<Comment>> forest, Comment root)
-
setUnresolvedCommentCount
public void setUnresolvedCommentCount(Integer count)
-
totalCommentCount
public Integer totalCommentCount()
-
setTotalCommentCount
public void setTotalCommentCount(Integer count)
-
messages
public List<ChangeMessage> messages()
-
submitRecords
public List<SubmitRecord> submitRecords(SubmitRuleOptions options)
-
getSubmitRecords
public List<SubmitRecord> getSubmitRecords(SubmitRuleOptions options)
-
setSubmitRecords
public void setSubmitRecords(SubmitRuleOptions options, List<SubmitRecord> records)
-
submitTypeRecord
public SubmitTypeRecord submitTypeRecord()
-
setMergeable
public void setMergeable(Boolean mergeable)
-
isMergeable
public Boolean isMergeable()
-
editsByUser
public Set<Account.Id> editsByUser()
-
editRefs
public Map<Account.Id,org.eclipse.jgit.lib.Ref> editRefs()
-
draftsByUser
public Set<Account.Id> draftsByUser()
-
draftRefs
public Map<Account.Id,org.eclipse.jgit.lib.Ref> draftRefs()
-
isReviewedBy
public boolean isReviewedBy(Account.Id accountId)
-
reviewedBy
public Set<Account.Id> reviewedBy()
-
setReviewedBy
public void setReviewedBy(Set<Account.Id> reviewedBy)
-
stars
public com.google.common.collect.ImmutableListMultimap<Account.Id,String> stars()
-
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()
-
stars
public Set<String> stars(Account.Id accountId)
-
isPureRevert
public Boolean isPureRevert()
- Returns:
null
ifrevertOf
isnull
; 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)
-
-