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 Summary
Modifier and TypeMethodDescriptionstatic com.google.common.collect.ImmutableSet<AttentionSetUpdate>
additionsOnly
(Collection<AttentionSetUpdate> updates) Returns only updates where the user was added.static AttentionSetInfo
createAttentionSetInfo
(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.Id
resolveAccount
(AccountResolver accountResolver, ChangeNotes changeNotes, String user) Returns theAccount.Id
ofuser
if the user is active on the change, and exists.static void
validateInput
(AttentionSetInput input) Validates the input for AttentionSetInput.
-
Method Details
-
additionsOnly
public static com.google.common.collect.ImmutableSet<AttentionSetUpdate> additionsOnly(Collection<AttentionSetUpdate> updates) Returns only updates where the user was added. -
removalsOnly
public static com.google.common.collect.ImmutableSet<AttentionSetUpdate> removalsOnly(Collection<AttentionSetUpdate> updates) Returns only updates where the user was removed. -
validateInput
Validates the input for AttentionSetInput. This must be called for all inputs that relate to adding or removing attention set entries, except forRemoveFromAttentionSet
.- Throws:
BadRequestException
-
resolveAccount
public static Account.Id resolveAccount(AccountResolver accountResolver, ChangeNotes changeNotes, String user) throws org.eclipse.jgit.errors.ConfigInvalidException, IOException, BadRequestException Returns theAccount.Id
ofuser
if 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
-
createAttentionSetInfo
public static AttentionSetInfo createAttentionSetInfo(AttentionSetUpdate attentionSetUpdate, AccountLoader accountLoader)
-