public class LabelNormalizer
extends java.lang.Object
Votes are recorded in the database for a user based on the state of the project at that time: what labels are defined for the project, and what the user is allowed to vote on. Both of those can change between the time a vote is originally made and a later point, for example when a change is submitted. This class normalizes old votes against current project configuration.
Modifier and Type | Class and Description |
---|---|
static class |
LabelNormalizer.Result |
Modifier and Type | Method and Description |
---|---|
boolean |
canVote(ChangeControl ctl,
LabelType lt,
Account.Id id) |
LabelNormalizer.Result |
normalize(Change change,
java.util.Collection<PatchSetApproval> approvals) |
LabelNormalizer.Result |
normalize(ChangeControl ctl,
java.util.Collection<PatchSetApproval> approvals) |
public LabelNormalizer.Result normalize(Change change, java.util.Collection<PatchSetApproval> approvals) throws com.google.gwtorm.server.OrmException
change
- change containing the given approvals.approvals
- list of approvals.com.google.gwtorm.server.OrmException
public LabelNormalizer.Result normalize(ChangeControl ctl, java.util.Collection<PatchSetApproval> approvals)
ctl
- change control containing the given approvals.approvals
- list of approvals.public boolean canVote(ChangeControl ctl, LabelType lt, Account.Id id)
ctl
- change control (for any user).lt
- label type.id
- account ID.