Package com.google.gerrit.server.util
Class AttentionSetUtil
java.lang.Object
com.google.gerrit.server.util.AttentionSetUtil
Common helpers for dealing with attention set data structures.
- 
Method SummaryModifier and TypeMethodDescriptionstatic com.google.common.collect.ImmutableSet<AttentionSetUpdate>additionsOnly(Collection<AttentionSetUpdate> updates) Returns only updates where the user was added.static AttentionSetInfocreateAttentionSetInfo(AttentionSetUpdate attentionSetUpdate, AccountLoader accountLoader) static com.google.common.collect.ImmutableSet<AttentionSetUpdate>removalsOnly(Collection<AttentionSetUpdate> updates) Returns only updates where the user was removed.static Account.IdresolveAccount(AccountResolver accountResolver, ChangeNotes changeNotes, String user) Returns theAccount.Idofuserif the user is active on the change, and exists.static voidvalidateInput(AttentionSetInput input) Validates the input for AttentionSetInput.
- 
Method Details- 
additionsOnlypublic static com.google.common.collect.ImmutableSet<AttentionSetUpdate> additionsOnly(Collection<AttentionSetUpdate> updates) Returns only updates where the user was added.
- 
removalsOnlypublic static com.google.common.collect.ImmutableSet<AttentionSetUpdate> removalsOnly(Collection<AttentionSetUpdate> updates) Returns only updates where the user was removed.
- 
validateInputValidates the input for AttentionSetInput. This must be called for all inputs that relate to adding or removing attention set entries, except forRemoveFromAttentionSet.- Throws:
- BadRequestException
 
- 
resolveAccountpublic static Account.Id resolveAccount(AccountResolver accountResolver, ChangeNotes changeNotes, String user) throws org.eclipse.jgit.errors.ConfigInvalidException, IOException, BadRequestException Returns theAccount.Idofuserif the user is active on the change, and exists. If the user doesn't exist or is not active on the change, the same exception is thrown to disallow probing for account existence based on exception type.- Throws:
- org.eclipse.jgit.errors.ConfigInvalidException
- IOException
- BadRequestException
 
- 
createAttentionSetInfopublic static AttentionSetInfo createAttentionSetInfo(AttentionSetUpdate attentionSetUpdate, AccountLoader accountLoader) 
 
-