Class AccountDelta.Builder
- Enclosing class:
- AccountDelta
AccountDelta
.
Account data is only updated if the corresponding setter is invoked. If a setter is not
invoked the corresponding data stays unchanged. To unset string values the setter can be
invoked with either null
or an empty string (null
is converted to an empty
string by using the AccountDelta.Builder.WrapperThatConvertsNullStringArgsToEmptyStrings
wrapper, see AccountDelta.builder()
).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExternalId
(ExternalId extId) Adds a new external ID for the account.addExternalIds
(Collection<ExternalId> extIds) Adds new external IDs for the account.abstract AccountDelta
build()
Builds the instance.deleteAccount
(Collection<ExternalId> extIdsToDelete) Builds an AccountDelta that deletes all data.deleteExternalId
(ExternalId extId) Deletes an external ID for the account.deleteExternalIds
(Collection<ExternalId> extIds) Deletes external IDs for the account.deleteProjectWatch
(ProjectWatches.ProjectWatchKey projectWatch) Deletes a project watch for the account.deleteProjectWatches
(Collection<ProjectWatches.ProjectWatchKey> projectWatches) Deletes project watches for the account.replaceExternalId
(ExternalId extIdToDelete, ExternalId extIdToAdd) Replaces an external ID.replaceExternalIds
(Collection<ExternalId> extIdsToDelete, Collection<ExternalId> extIdsToAdd) Replaces an external IDs.abstract AccountDelta.Builder
setActive
(boolean active) Sets the active flag for the account.abstract AccountDelta.Builder
setDiffPreferences
(DiffPreferencesInfo diffPreferences) Sets the diff preferences for the account.abstract AccountDelta.Builder
setDisplayName
(String displayName) Sets a new display name for the account.abstract AccountDelta.Builder
setEditPreferences
(EditPreferencesInfo editPreferences) Sets the edit preferences for the account.abstract AccountDelta.Builder
setFullName
(String fullName) Sets a new full name for the account.abstract AccountDelta.Builder
setGeneralPreferences
(GeneralPreferencesInfo generalPreferences) Sets the general preferences for the account.abstract AccountDelta.Builder
setPreferredEmail
(String preferredEmail) Sets a new preferred email for the account.abstract AccountDelta.Builder
setShouldDeleteAccount
(boolean shouldDelete) abstract AccountDelta.Builder
Sets a new status for the account.updateExternalId
(ExternalId extId) Updates an external ID for the account.updateExternalIds
(Collection<ExternalId> extIds) Updates external IDs for the account.updateProjectWatch
(ProjectWatches.ProjectWatchKey projectWatchKey, Set<NotifyConfig.NotifyType> notifyTypes) Updates a project watch for the account.updateProjectWatches
(Map<ProjectWatches.ProjectWatchKey, Set<NotifyConfig.NotifyType>> projectWatches) Updates project watches for the account.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setFullName
Sets a new full name for the account.- Parameters:
fullName
- the new full name, ifnull
or empty string the full name is unset
-
setDisplayName
Sets a new display name for the account.- Parameters:
displayName
- the new display name, ifnull
or empty string the display name is unset
-
setPreferredEmail
Sets a new preferred email for the account.- Parameters:
preferredEmail
- the new preferred email, ifnull
or empty string the preferred email is unset
-
setActive
Sets the active flag for the account.- Parameters:
active
-true
if the account should be set to active,false
if the account should be set to inactive
-
setStatus
Sets a new status for the account.- Parameters:
status
- the new status, ifnull
or empty string the status is unset
-
addExternalId
Adds a new external ID for the account.The account ID of the external ID must match the account ID of the account that is updated.
If an external ID with the same ID already exists the account update will fail with
DuplicateExternalIdKeyException
.- Parameters:
extId
- external ID that should be added- Returns:
- the builder
-
addExternalIds
Adds new external IDs for the account.The account IDs of the external IDs must match the account ID of the account that is updated.
If any of the external ID keys already exists, the insert fails with
DuplicateExternalIdKeyException
.- Parameters:
extIds
- external IDs that should be added- Returns:
- the builder
-
updateExternalId
Updates an external ID for the account.The account ID of the external ID must match the account ID of the account that is updated.
If no external ID with the ID exists the external ID is created.
- Parameters:
extId
- external ID that should be updated- Returns:
- the builder
-
updateExternalIds
Updates external IDs for the account.The account IDs of the external IDs must match the account ID of the account that is updated.
If any of the external IDs already exists, it is overwritten. New external IDs are inserted.
- Parameters:
extIds
- external IDs that should be updated- Returns:
- the builder
-
deleteExternalId
Deletes an external ID for the account.The account ID of the external ID must match the account ID of the account that is updated.
If no external ID with the ID exists this is a no-op.
- Parameters:
extId
- external ID that should be deleted- Returns:
- the builder
-
deleteExternalIds
Deletes external IDs for the account.The account IDs of the external IDs must match the account ID of the account that is updated.
For non-existing external IDs this is a no-op.
- Parameters:
extIds
- external IDs that should be deleted- Returns:
- the builder
-
replaceExternalId
@CanIgnoreReturnValue public AccountDelta.Builder replaceExternalId(ExternalId extIdToDelete, ExternalId extIdToAdd) Replaces an external ID.- Parameters:
extIdToDelete
- external ID that should be deletedextIdToAdd
- external ID that should be added- Returns:
- the builder
-
replaceExternalIds
@CanIgnoreReturnValue public AccountDelta.Builder replaceExternalIds(Collection<ExternalId> extIdsToDelete, Collection<ExternalId> extIdsToAdd) Replaces an external IDs.- Parameters:
extIdsToDelete
- external IDs that should be deletedextIdsToAdd
- external IDs that should be added- Returns:
- the builder
-
updateProjectWatch
@CanIgnoreReturnValue public AccountDelta.Builder updateProjectWatch(ProjectWatches.ProjectWatchKey projectWatchKey, Set<NotifyConfig.NotifyType> notifyTypes) Updates a project watch for the account.If no project watch with the key exists the project watch is created.
- Parameters:
projectWatchKey
- key of the project watch that should be updatednotifyTypes
- the notify types that should be set for the project watch- Returns:
- the builder
-
updateProjectWatches
@CanIgnoreReturnValue public AccountDelta.Builder updateProjectWatches(Map<ProjectWatches.ProjectWatchKey, Set<NotifyConfig.NotifyType>> projectWatches) Updates project watches for the account.If any of the project watches already exists, it is overwritten. New project watches are inserted.
- Parameters:
projectWatches
- project watches that should be updated- Returns:
- the builder
-
deleteProjectWatch
@CanIgnoreReturnValue public AccountDelta.Builder deleteProjectWatch(ProjectWatches.ProjectWatchKey projectWatch) Deletes a project watch for the account.If no project watch with the ID exists this is a no-op.
- Parameters:
projectWatch
- project watch that should be deleted- Returns:
- the builder
-
deleteProjectWatches
@CanIgnoreReturnValue public AccountDelta.Builder deleteProjectWatches(Collection<ProjectWatches.ProjectWatchKey> projectWatches) Deletes project watches for the account.For non-existing project watches this is a no-op.
- Parameters:
projectWatches
- project watches that should be deleted- Returns:
- the builder
-
setGeneralPreferences
@CanIgnoreReturnValue public abstract AccountDelta.Builder setGeneralPreferences(GeneralPreferencesInfo generalPreferences) Sets the general preferences for the account.Updates any preference that is non-null in the provided GeneralPreferencesInfo.
- Parameters:
generalPreferences
- the general preferences that should be set- Returns:
- the builder
-
setDiffPreferences
@CanIgnoreReturnValue public abstract AccountDelta.Builder setDiffPreferences(DiffPreferencesInfo diffPreferences) Sets the diff preferences for the account.Updates any preference that is non-null in the provided DiffPreferencesInfo.
- Parameters:
diffPreferences
- the diff preferences that should be set- Returns:
- the builder
-
setEditPreferences
@CanIgnoreReturnValue public abstract AccountDelta.Builder setEditPreferences(EditPreferencesInfo editPreferences) Sets the edit preferences for the account.Updates any preference that is non-null in the provided EditPreferencesInfo.
- Parameters:
editPreferences
- the edit preferences that should be set- Returns:
- the builder
-
setShouldDeleteAccount
@CanIgnoreReturnValue public abstract AccountDelta.Builder setShouldDeleteAccount(boolean shouldDelete) -
deleteAccount
@CanIgnoreReturnValue public AccountDelta.Builder deleteAccount(Collection<ExternalId> extIdsToDelete) Builds an AccountDelta that deletes all data.- Parameters:
extIdsToDelete
- external IDs that should be deleted- Returns:
- the builder
-
build
Builds the instance.
-