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 class
StarredChangesUtil.IllegalLabelException
static class
StarredChangesUtil.InvalidLabelsException
static class
StarredChangesUtil.MutuallyExclusiveLabelsException
static class
StarredChangesUtil.Operation
static class
StarredChangesUtil.StarField
static class
StarredChangesUtil.StarRef
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_LABEL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableSet<Change.Id>
byAccountId(Account.Id accountId)
com.google.common.collect.ImmutableMap<Account.Id,StarredChangesUtil.StarRef>
byChange(Change.Id changeId)
NavigableSet<String>
getLabels(Account.Id accountId, Change.Id changeId)
org.eclipse.jgit.lib.ObjectId
getObjectId(Account.Id accountId, Change.Id changeId)
static StarredChangesUtil.StarRef
readLabels(org.eclipse.jgit.lib.Repository repo, String refName)
static StarredChangesUtil.StarRef
readLabels(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.Ref ref)
void
star(Account.Id accountId, Change.Id changeId, StarredChangesUtil.Operation op)
void
unstarAllForChangeDeletion(Change.Id changeId)
Unstar the given change for all users.static org.eclipse.jgit.lib.ObjectId
writeLabels(org.eclipse.jgit.lib.Repository repo, Collection<String> labels)
-
-
-
Field Detail
-
DEFAULT_LABEL
public static final String DEFAULT_LABEL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLabels
public NavigableSet<String> getLabels(Account.Id accountId, Change.Id changeId)
-
star
public void star(Account.Id accountId, Change.Id changeId, StarredChangesUtil.Operation op) throws StarredChangesUtil.IllegalLabelException
-
unstarAllForChangeDeletion
public void unstarAllForChangeDeletion(Change.Id changeId) throws IOException
Unstar the given change for all users.Intended for use only when we're about to delete a change. For that reason, the change is not reindexed.
- Parameters:
changeId
- change ID.- Throws:
IOException
- if an error occurred.
-
byChange
public com.google.common.collect.ImmutableMap<Account.Id,StarredChangesUtil.StarRef> byChange(Change.Id changeId)
-
byAccountId
public com.google.common.collect.ImmutableSet<Change.Id> byAccountId(Account.Id accountId)
-
getObjectId
public org.eclipse.jgit.lib.ObjectId getObjectId(Account.Id accountId, Change.Id changeId)
-
readLabels
public static StarredChangesUtil.StarRef readLabels(org.eclipse.jgit.lib.Repository repo, String refName) throws IOException
- Throws:
IOException
-
readLabels
public static StarredChangesUtil.StarRef readLabels(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.Ref ref) 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
-
-