Package com.google.gerrit.server
Class StarredChangesUtil
- java.lang.Object
-
- com.google.gerrit.server.StarredChangesUtil
-
public class StarredChangesUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStarredChangesUtil.IllegalLabelExceptionstatic classStarredChangesUtil.InvalidLabelsExceptionstatic classStarredChangesUtil.MutuallyExclusiveLabelsExceptionstatic classStarredChangesUtil.StarFieldstatic classStarredChangesUtil.StarRef
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_LABELstatic com.google.common.collect.ImmutableSortedSet<String>DEFAULT_LABELSstatic StringIGNORE_LABELstatic StringREVIEWED_LABELstatic StringUNREVIEWED_LABEL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableMap<Account.Id,StarredChangesUtil.StarRef>byChange(Change.Id changeId)com.google.common.collect.ImmutableListMultimap<Account.Id,String>byChangeFromIndex(Change.Id changeId)com.google.common.collect.ImmutableSortedSet<String>getLabels(Account.Id accountId, Change.Id changeId)org.eclipse.jgit.lib.ObjectIdgetObjectId(Account.Id accountId, Change.Id changeId)static Set<Integer>getStarredPatchSets(Set<String> labels, String label)voidignore(ChangeResource rsrc)booleanisIgnored(ChangeResource rsrc)booleanisIgnoredBy(Change.Id changeId, Account.Id accountId)voidmarkAsReviewed(ChangeResource rsrc)voidmarkAsUnreviewed(ChangeResource rsrc)static StarredChangesUtil.StarRefreadLabels(org.eclipse.jgit.lib.Repository repo, String refName)com.google.common.collect.ImmutableSortedSet<String>star(Account.Id accountId, Project.NameKey project, Change.Id changeId, Set<String> labelsToAdd, Set<String> labelsToRemove)voidunignore(ChangeResource rsrc)voidunstarAll(Project.NameKey project, Change.Id changeId)static org.eclipse.jgit.lib.ObjectIdwriteLabels(org.eclipse.jgit.lib.Repository repo, Collection<String> labels)
-
-
-
Field Detail
-
DEFAULT_LABEL
public static final String DEFAULT_LABEL
- See Also:
- Constant Field Values
-
IGNORE_LABEL
public static final String IGNORE_LABEL
- See Also:
- Constant Field Values
-
REVIEWED_LABEL
public static final String REVIEWED_LABEL
- See Also:
- Constant Field Values
-
UNREVIEWED_LABEL
public static final String UNREVIEWED_LABEL
- See Also:
- Constant Field Values
-
DEFAULT_LABELS
public static final com.google.common.collect.ImmutableSortedSet<String> DEFAULT_LABELS
-
-
Method Detail
-
getLabels
public com.google.common.collect.ImmutableSortedSet<String> getLabels(Account.Id accountId, Change.Id changeId)
-
star
public com.google.common.collect.ImmutableSortedSet<String> star(Account.Id accountId, Project.NameKey project, Change.Id changeId, Set<String> labelsToAdd, Set<String> labelsToRemove) throws StarredChangesUtil.IllegalLabelException
-
unstarAll
public void unstarAll(Project.NameKey project, Change.Id changeId)
-
byChange
public com.google.common.collect.ImmutableMap<Account.Id,StarredChangesUtil.StarRef> byChange(Change.Id changeId)
-
byChangeFromIndex
public com.google.common.collect.ImmutableListMultimap<Account.Id,String> byChangeFromIndex(Change.Id changeId)
-
getObjectId
public org.eclipse.jgit.lib.ObjectId getObjectId(Account.Id accountId, Change.Id changeId)
-
ignore
public void ignore(ChangeResource rsrc) throws StarredChangesUtil.IllegalLabelException
-
unignore
public void unignore(ChangeResource rsrc) throws StarredChangesUtil.IllegalLabelException
-
isIgnoredBy
public boolean isIgnoredBy(Change.Id changeId, Account.Id accountId)
-
isIgnored
public boolean isIgnored(ChangeResource rsrc)
-
markAsReviewed
public void markAsReviewed(ChangeResource rsrc) throws StarredChangesUtil.IllegalLabelException
-
markAsUnreviewed
public void markAsUnreviewed(ChangeResource rsrc) throws StarredChangesUtil.IllegalLabelException
-
readLabels
public static StarredChangesUtil.StarRef readLabels(org.eclipse.jgit.lib.Repository repo, String refName) throws IOException
- Throws:
IOException
-
writeLabels
public static org.eclipse.jgit.lib.ObjectId writeLabels(org.eclipse.jgit.lib.Repository repo, Collection<String> labels) throws IOException, StarredChangesUtil.InvalidLabelsException
-
-