public abstract static class InternalAccountUpdate.Builder
extends java.lang.Object
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 WrapperThatConvertsNullStringArgsToEmptyStrings
wrapper, see InternalAccountUpdate.builder()
).
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
InternalAccountUpdate.Builder |
addExternalId(ExternalId extId)
Adds a new external ID for the account.
|
InternalAccountUpdate.Builder |
addExternalIds(java.util.Collection<ExternalId> extIds)
Adds new external IDs for the account.
|
abstract InternalAccountUpdate |
build()
Builds the account update.
|
InternalAccountUpdate.Builder |
deleteExternalId(ExternalId extId)
Deletes an external ID for the account.
|
InternalAccountUpdate.Builder |
deleteExternalIds(java.util.Collection<ExternalId> extIds)
Deletes external IDs for the account.
|
InternalAccountUpdate.Builder |
deleteProjectWatch(ProjectWatches.ProjectWatchKey projectWatch)
Deletes a project watch for the account.
|
InternalAccountUpdate.Builder |
deleteProjectWatches(java.util.Collection<ProjectWatches.ProjectWatchKey> projectWatches)
Deletes project watches for the account.
|
InternalAccountUpdate.Builder |
replaceExternalId(ExternalId extIdToDelete,
ExternalId extIdToAdd)
Replaces an external ID.
|
InternalAccountUpdate.Builder |
replaceExternalIds(java.util.Collection<ExternalId> extIdsToDelete,
java.util.Collection<ExternalId> extIdsToAdd)
Replaces an external IDs.
|
abstract InternalAccountUpdate.Builder |
setActive(boolean active)
Sets the active flag for the account.
|
abstract InternalAccountUpdate.Builder |
setDiffPreferences(DiffPreferencesInfo diffPreferences)
Sets the diff preferences for the account.
|
abstract InternalAccountUpdate.Builder |
setEditPreferences(EditPreferencesInfo editPreferences)
Sets the edit preferences for the account.
|
abstract InternalAccountUpdate.Builder |
setFullName(java.lang.String fullName)
Sets a new full name for the account.
|
abstract InternalAccountUpdate.Builder |
setGeneralPreferences(GeneralPreferencesInfo generalPreferences)
Sets the general preferences for the account.
|
abstract InternalAccountUpdate.Builder |
setPreferredEmail(java.lang.String preferredEmail)
Sets a new preferred email for the account.
|
abstract InternalAccountUpdate.Builder |
setStatus(java.lang.String status)
Sets a new status for the account.
|
InternalAccountUpdate.Builder |
updateExternalId(ExternalId extId)
Updates an external ID for the account.
|
InternalAccountUpdate.Builder |
updateExternalIds(java.util.Collection<ExternalId> extIds)
Updates external IDs for the account.
|
InternalAccountUpdate.Builder |
updateProjectWatch(ProjectWatches.ProjectWatchKey projectWatchKey,
java.util.Set<ProjectWatches.NotifyType> notifyTypes)
Updates a project watch for the account.
|
InternalAccountUpdate.Builder |
updateProjectWatches(java.util.Map<ProjectWatches.ProjectWatchKey,java.util.Set<ProjectWatches.NotifyType>> projectWatches)
Updates project watches for the account.
|
public abstract InternalAccountUpdate.Builder setFullName(java.lang.String fullName)
fullName
- the new full name, if null
or empty string the full name is unsetpublic abstract InternalAccountUpdate.Builder setPreferredEmail(java.lang.String preferredEmail)
preferredEmail
- the new preferred email, if null
or empty string the preferred
email is unsetpublic abstract InternalAccountUpdate.Builder setActive(boolean active)
active
- true
if the account should be set to active, false
if the
account should be set to inactivepublic abstract InternalAccountUpdate.Builder setStatus(java.lang.String status)
status
- the new status, if null
or empty string the status is unsetpublic InternalAccountUpdate.Builder addExternalId(ExternalId extId)
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
.
extId
- external ID that should be addedpublic InternalAccountUpdate.Builder addExternalIds(java.util.Collection<ExternalId> extIds)
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
.
extIds
- external IDs that should be addedpublic InternalAccountUpdate.Builder updateExternalId(ExternalId extId)
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.
extId
- external ID that should be updatedpublic InternalAccountUpdate.Builder updateExternalIds(java.util.Collection<ExternalId> extIds)
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.
extIds
- external IDs that should be updatedpublic InternalAccountUpdate.Builder deleteExternalId(ExternalId extId)
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.
extId
- external ID that should be deletedpublic InternalAccountUpdate.Builder deleteExternalIds(java.util.Collection<ExternalId> extIds)
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.
extIds
- external IDs that should be deletedpublic InternalAccountUpdate.Builder replaceExternalId(ExternalId extIdToDelete, ExternalId extIdToAdd)
extIdToDelete
- external ID that should be deletedextIdToAdd
- external ID that should be addedpublic InternalAccountUpdate.Builder replaceExternalIds(java.util.Collection<ExternalId> extIdsToDelete, java.util.Collection<ExternalId> extIdsToAdd)
extIdsToDelete
- external IDs that should be deletedextIdsToAdd
- external IDs that should be addedpublic InternalAccountUpdate.Builder updateProjectWatch(ProjectWatches.ProjectWatchKey projectWatchKey, java.util.Set<ProjectWatches.NotifyType> notifyTypes)
If no project watch with the key exists the project watch is created.
projectWatchKey
- key of the project watch that should be updatednotifyTypes
- the notify types that should be set for the project watchpublic InternalAccountUpdate.Builder updateProjectWatches(java.util.Map<ProjectWatches.ProjectWatchKey,java.util.Set<ProjectWatches.NotifyType>> projectWatches)
If any of the project watches already exists, it is overwritten. New project watches are inserted.
projectWatches
- project watches that should be updatedpublic InternalAccountUpdate.Builder deleteProjectWatch(ProjectWatches.ProjectWatchKey projectWatch)
If no project watch with the ID exists this is a no-op.
projectWatch
- project watch that should be deletedpublic InternalAccountUpdate.Builder deleteProjectWatches(java.util.Collection<ProjectWatches.ProjectWatchKey> projectWatches)
For non-existing project watches this is a no-op.
projectWatches
- project watches that should be deletedpublic abstract InternalAccountUpdate.Builder setGeneralPreferences(GeneralPreferencesInfo generalPreferences)
Updates any preference that is non-null in the provided GeneralPreferencesInfo.
generalPreferences
- the general preferences that should be setpublic abstract InternalAccountUpdate.Builder setDiffPreferences(DiffPreferencesInfo diffPreferences)
Updates any preference that is non-null in the provided DiffPreferencesInfo.
diffPreferences
- the diff preferences that should be setpublic abstract InternalAccountUpdate.Builder setEditPreferences(EditPreferencesInfo editPreferences)
Updates any preference that is non-null in the provided EditPreferencesInfo.
editPreferences
- the edit preferences that should be setpublic abstract InternalAccountUpdate build()