public abstract static class InternalAccountUpdate.Builder extends 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() |
public abstract InternalAccountUpdate.Builder setFullName(String fullName)
fullName
- the new full name, if null
or empty string the full name is unsetpublic abstract InternalAccountUpdate.Builder setPreferredEmail(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(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(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(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(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(Collection<ExternalId> extIdsToDelete, Collection<ExternalId> extIdsToAdd)
extIdsToDelete
- external IDs that should be deletedextIdsToAdd
- external IDs that should be addedpublic InternalAccountUpdate.Builder updateProjectWatch(ProjectWatches.ProjectWatchKey projectWatchKey, 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(Map<ProjectWatches.ProjectWatchKey,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(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()