Class InternalAccountUpdate
- java.lang.Object
-
- com.google.gerrit.server.account.InternalAccountUpdate
-
public abstract class InternalAccountUpdate extends Object
Class to prepare updates to an account.Account updates are done through
AccountsUpdate
. This class should be used to tellAccountsUpdate
how an account should be modified.This class allows to prepare updates of account properties, external IDs, preferences (general, diff and edit preferences) and project watches. The account ID and the registration date cannot be updated.
For the account properties there are getters in this class and the setters in the
InternalAccountUpdate.Builder
that correspond to the fields inAccount
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InternalAccountUpdate.Builder
Class to build an account update.
-
Constructor Summary
Constructors Constructor Description InternalAccountUpdate()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static InternalAccountUpdate.Builder
builder()
abstract Optional<Boolean>
getActive()
Returns the new value for the active flag.abstract com.google.common.collect.ImmutableSet<ExternalId>
getCreatedExternalIds()
Returns external IDs that should be newly created for the account.abstract com.google.common.collect.ImmutableSet<ExternalId>
getDeletedExternalIds()
Returns external IDs that should be deleted for the account.abstract com.google.common.collect.ImmutableSet<ProjectWatches.ProjectWatchKey>
getDeletedProjectWatches()
Returns project watches that should be deleted for the account.abstract Optional<DiffPreferencesInfo>
getDiffPreferences()
Returns the new value for the diff preferences.abstract Optional<String>
getDisplayName()
Returns the new value for the display name.abstract Optional<EditPreferencesInfo>
getEditPreferences()
Returns the new value for the edit preferences.abstract Optional<String>
getFullName()
Returns the new value for the full name.abstract Optional<GeneralPreferencesInfo>
getGeneralPreferences()
Returns the new value for the general preferences.abstract Optional<String>
getPreferredEmail()
Returns the new value for the preferred email.abstract Optional<String>
getStatus()
Returns the new value for the status.abstract com.google.common.collect.ImmutableSet<ExternalId>
getUpdatedExternalIds()
Returns external IDs that should be updated for the account.abstract com.google.common.collect.ImmutableMap<ProjectWatches.ProjectWatchKey,Set<NotifyConfig.NotifyType>>
getUpdatedProjectWatches()
Returns external IDs that should be updated for the account.
-
-
-
Method Detail
-
builder
public static InternalAccountUpdate.Builder builder()
-
getFullName
public abstract Optional<String> getFullName()
Returns the new value for the full name.- Returns:
- the new value for the full name,
Optional#empty()
if the full name is not being updated,Optional#of("")
if the full name is unset, the wrapped value is nevernull
-
getDisplayName
public abstract Optional<String> getDisplayName()
Returns the new value for the display name.- Returns:
- the new value for the display name,
Optional#empty()
if the display name is not being updated,Optional#of("")
if the display name is unset, the wrapped value is nevernull
-
getPreferredEmail
public abstract Optional<String> getPreferredEmail()
Returns the new value for the preferred email.- Returns:
- the new value for the preferred email,
Optional#empty()
if the preferred email is not being updated,Optional#of("")
if the preferred email is unset, the wrapped value is nevernull
-
getActive
public abstract Optional<Boolean> getActive()
Returns the new value for the active flag.- Returns:
- the new value for the active flag,
Optional#empty()
if the active flag is not being updated, the wrapped value is nevernull
-
getStatus
public abstract Optional<String> getStatus()
Returns the new value for the status.- Returns:
- the new value for the status,
Optional#empty()
if the status is not being updated,Optional#of("")
if the status is unset, the wrapped value is nevernull
-
getCreatedExternalIds
public abstract com.google.common.collect.ImmutableSet<ExternalId> getCreatedExternalIds()
Returns external IDs that should be newly created for the account.- Returns:
- external IDs that should be newly created for the account
-
getUpdatedExternalIds
public abstract com.google.common.collect.ImmutableSet<ExternalId> getUpdatedExternalIds()
Returns external IDs that should be updated for the account.- Returns:
- external IDs that should be updated for the account
-
getDeletedExternalIds
public abstract com.google.common.collect.ImmutableSet<ExternalId> getDeletedExternalIds()
Returns external IDs that should be deleted for the account.- Returns:
- external IDs that should be deleted for the account
-
getUpdatedProjectWatches
public abstract com.google.common.collect.ImmutableMap<ProjectWatches.ProjectWatchKey,Set<NotifyConfig.NotifyType>> getUpdatedProjectWatches()
Returns external IDs that should be updated for the account.- Returns:
- external IDs that should be updated for the account
-
getDeletedProjectWatches
public abstract com.google.common.collect.ImmutableSet<ProjectWatches.ProjectWatchKey> getDeletedProjectWatches()
Returns project watches that should be deleted for the account.- Returns:
- project watches that should be deleted for the account
-
getGeneralPreferences
public abstract Optional<GeneralPreferencesInfo> getGeneralPreferences()
Returns the new value for the general preferences.Only preferences that are non-null in the returned GeneralPreferencesInfo should be updated.
- Returns:
- the new value for the general preferences,
Optional#empty()
if the general preferences are not being updated, the wrapped value is nevernull
-
getDiffPreferences
public abstract Optional<DiffPreferencesInfo> getDiffPreferences()
Returns the new value for the diff preferences.Only preferences that are non-null in the returned DiffPreferencesInfo should be updated.
- Returns:
- the new value for the diff preferences,
Optional#empty()
if the diff preferences are not being updated, the wrapped value is nevernull
-
getEditPreferences
public abstract Optional<EditPreferencesInfo> getEditPreferences()
Returns the new value for the edit preferences.Only preferences that are non-null in the returned DiffPreferencesInfo should be updated.
- Returns:
- the new value for the edit preferences,
Optional#empty()
if the edit preferences are not being updated, the wrapped value is nevernull
-
-