public class LabelNormalizer extends 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 |
---|---|
LabelNormalizer.Result |
normalize(ChangeNotes notes,
Collection<PatchSetApproval> approvals) |
LabelNormalizer.Result |
normalize(ChangeNotes notes,
CurrentUser user,
Collection<PatchSetApproval> approvals) |
public LabelNormalizer.Result normalize(ChangeNotes notes, Collection<PatchSetApproval> approvals) throws com.google.gwtorm.server.OrmException, PermissionBackendException, IOException
notes
- change containing the given approvals.approvals
- list of approvals.com.google.gwtorm.server.OrmException
PermissionBackendException
IOException
public LabelNormalizer.Result normalize(ChangeNotes notes, CurrentUser user, Collection<PatchSetApproval> approvals) throws PermissionBackendException, IOException
notes
- change notes containing the given approvals.user
- current user.approvals
- list of approvals.PermissionBackendException
IOException