Class CustomerUpdateActionUtils
- java.lang.Object
 - 
- com.commercetools.sync.customers.utils.CustomerUpdateActionUtils
 
 
- 
public final class CustomerUpdateActionUtils extends java.lang.Object 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCUSTOMER_NUMBER_EXISTS_WARNING 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildAddAddressUpdateActions(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomerDraft.getAddresses()and aCustomer.getAddresses().static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildAddBillingAddressUpdateActions(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomer.getBillingAddresses()and aCustomerDraft.getBillingAddresses().static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildAddShippingAddressUpdateActions(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomer.getShippingAddresses()and aCustomerDraft.getShippingAddresses().static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildAddStoreUpdateActions(java.util.List<io.sphere.sdk.models.KeyReference<io.sphere.sdk.stores.Store>> oldStores, java.util.List<io.sphere.sdk.models.ResourceIdentifier<io.sphere.sdk.stores.Store>> newStores)Compares theListofStoreKeyReferences andStoreResourceIdentifiers of aCustomerDraftand aCustomer.static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildAllAddressUpdateActions(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares the addresses of aCustomerand aCustomerDraft.static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildChangeAddressUpdateActions(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomerDraft.getAddresses()and aCustomer.getAddresses().static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildChangeEmailUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theemailvalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"changeEmail"UpdateAction.static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildRemoveAddressUpdateActions(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomerDraft.getAddresses()and aCustomer.getAddresses().static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildRemoveBillingAddressUpdateActions(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomer.getBillingAddresses()and aCustomerDraft.getBillingAddresses().static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildRemoveShippingAddressUpdateActions(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomer.getShippingAddresses()and aCustomerDraft.getShippingAddresses().static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildRemoveStoreUpdateActions(java.util.List<io.sphere.sdk.models.KeyReference<io.sphere.sdk.stores.Store>> oldStores, java.util.List<io.sphere.sdk.models.ResourceIdentifier<io.sphere.sdk.stores.Store>> newStores)Compares theListofStoreKeyReferences andStoreResourceIdentifiers of aCustomerDraftand aCustomer.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetCompanyNameUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thecompanyNamevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setCompanyName"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetCustomerGroupUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theCustomerGroupreferences of an oldCustomerand newCustomerDraft.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetCustomerNumberUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer, CustomerSyncOptions syncOptions)Compares thecustomerNumbervalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setCustomerNumber"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetDateOfBirthUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thedateOfBirthvalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setDateOfBirth"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetDefaultBillingAddressUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theCustomer.getDefaultBillingAddress()andCustomerDraft.getDefaultBillingAddress().static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetDefaultShippingAddressUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theCustomer.getDefaultShippingAddress()andCustomerDraft.getDefaultShippingAddress().static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetExternalIdUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theexternalIdvalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setExternalId"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetFirstNameUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thefirstNamevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setFirstName"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetLastNameUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thelastNamevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setLastName"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetLocaleUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thelocalevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setLocale"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetMiddleNameUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares themiddleNamevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setMiddleName"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetSalutationUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thesalutationvalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"SetSalutation"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetTitleUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thetitlevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setTitle"UpdateAction.static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildSetVatIdUpdateAction(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thevatIdvalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setVatId"UpdateAction.static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>>buildStoreUpdateActions(io.sphere.sdk.customers.Customer oldCustomer, io.sphere.sdk.customers.CustomerDraft newCustomer)Compares the stores of aCustomerand aCustomerDraft. 
 - 
 
- 
- 
Field Detail
- 
CUSTOMER_NUMBER_EXISTS_WARNING
public static final java.lang.String CUSTOMER_NUMBER_EXISTS_WARNING
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
buildChangeEmailUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildChangeEmailUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theemailvalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"changeEmail"UpdateAction. If bothCustomerandCustomerDrafthave the sameemailvalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new email.- Returns:
 - optional containing update action or empty optional if emails are identical.
 
 
- 
buildSetFirstNameUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetFirstNameUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thefirstNamevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setFirstName"UpdateAction. If bothCustomerandCustomerDrafthave the samefirstNamevalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new first name.- Returns:
 - optional containing update action or empty optional if first names are identical.
 
 
- 
buildSetLastNameUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetLastNameUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thelastNamevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setLastName"UpdateAction. If bothCustomerandCustomerDrafthave the samelastNamevalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new last name.- Returns:
 - optional containing update action or empty optional if last names are identical.
 
 
- 
buildSetMiddleNameUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetMiddleNameUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares themiddleNamevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setMiddleName"UpdateAction. If bothCustomerandCustomerDrafthave the samemiddleNamevalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new middle name.- Returns:
 - optional containing update action or empty optional if middle names are identical.
 
 
- 
buildSetTitleUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetTitleUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thetitlevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setTitle"UpdateAction. If bothCustomerandCustomerDrafthave the sametitlevalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new title.- Returns:
 - optional containing update action or empty optional if titles are identical.
 
 
- 
buildSetSalutationUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetSalutationUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thesalutationvalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"SetSalutation"UpdateAction. If bothCustomerandCustomerDrafthave the samesalutationvalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the Customer that should be updated.newCustomer- the Customer draft that contains the new salutation.- Returns:
 - optional containing update action or empty optional if salutations are identical.
 
 
- 
buildSetCustomerNumberUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetCustomerNumberUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer, @Nonnull CustomerSyncOptions syncOptions)Compares thecustomerNumbervalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setCustomerNumber"UpdateAction. If bothCustomerandCustomerDrafthave the samecustomerNumbervalues, then no update action is needed and empty optional will be returned.Note: Customer number should be unique across a project. Once it's set it cannot be changed. For this case, warning callback will be triggered and an empty optional will be returned.
- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new customer number.syncOptions- responsible for supplying the sync options to the sync utility method. It is used for triggering the warning callback when trying to change an existing customer number.- Returns:
 - optional containing update action or empty optional if customer numbers are identical.
 
 
- 
buildSetExternalIdUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetExternalIdUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theexternalIdvalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setExternalId"UpdateAction. If bothCustomerandCustomerDrafthave the sameexternalIdvalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new external id.- Returns:
 - optional containing update action or empty optional if external ids are identical.
 
 
- 
buildSetCompanyNameUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetCompanyNameUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thecompanyNamevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setCompanyName"UpdateAction. If bothCustomerandCustomerDrafthave the samecompanyNamevalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new company name.- Returns:
 - optional containing update action or empty optional if company names are identical.
 
 
- 
buildSetDateOfBirthUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetDateOfBirthUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thedateOfBirthvalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setDateOfBirth"UpdateAction. If bothCustomerandCustomerDrafthave the samedateOfBirthvalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new date of birth.- Returns:
 - optional containing update action or empty optional if dates of birth are identical.
 
 
- 
buildSetVatIdUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetVatIdUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thevatIdvalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setVatId"UpdateAction. If bothCustomerandCustomerDrafthave the samevatIdvalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new vat id.- Returns:
 - optional containing update action or empty optional if vat ids are identical.
 
 
- 
buildSetLocaleUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetLocaleUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares thelocalevalues of aCustomerand aCustomerDraftand returns anOptionalof update action, which would contain the"setLocale"UpdateAction. If bothCustomerandCustomerDrafthave the samelocalevalues, then no update action is needed and empty optional will be returned.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft that contains the new locale.- Returns:
 - optional containing update action or empty optional if locales are identical.
 
 
- 
buildSetCustomerGroupUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetCustomerGroupUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theCustomerGroupreferences of an oldCustomerand newCustomerDraft. If they are different - returnSetCustomerGroupupdate action.If the old value is set, but the new one is empty - the command will unset the customer group.
- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft with newCustomerGroupreference.- Returns:
 - An optional with 
SetCustomerGroupupdate action. 
 
- 
buildStoreUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildStoreUpdateActions(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares the stores of aCustomerand aCustomerDraft. It returns aListofUpdateAction<Customer> as a result. If no update action is needed, for example in case where both theCustomerand theCustomerDrafthave the identical stores, an emptyListis returned.Note: Null values of the stores are filtered out.
- Parameters:
 oldCustomer- the customer which should be updated.newCustomer- the customer draft where we get the new data.- Returns:
 - A list of customer store-related update actions.
 
 
- 
buildRemoveStoreUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildRemoveStoreUpdateActions(@Nonnull java.util.List<io.sphere.sdk.models.KeyReference<io.sphere.sdk.stores.Store>> oldStores, @Nonnull java.util.List<io.sphere.sdk.models.ResourceIdentifier<io.sphere.sdk.stores.Store>> newStores)Compares theListofStoreKeyReferences andStoreResourceIdentifiers of aCustomerDraftand aCustomer. It returns aListofRemoveStoreupdate actions as a result, if the old store needs to be removed from a customer to have the same set of stores as the new customer. If both theCustomerand theCustomerDrafthave the same set of stores, then no update actions are needed and hence an emptyListis returned.Note: Null values of the stores are filtered out.
- Parameters:
 oldStores- the stores which should be updated.newStores- the stores where we get the new store.- Returns:
 - A list containing the update actions or an empty list if the store references are identical.
 
 
- 
buildAddStoreUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildAddStoreUpdateActions(@Nonnull java.util.List<io.sphere.sdk.models.KeyReference<io.sphere.sdk.stores.Store>> oldStores, @Nonnull java.util.List<io.sphere.sdk.models.ResourceIdentifier<io.sphere.sdk.stores.Store>> newStores)Compares theListofStoreKeyReferences andStoreResourceIdentifiers of aCustomerDraftand aCustomer. It returns aListofAddStoreupdate actions as a result, if the old store needs to be added to a customer to have the same set of stores as the new customer. If both theCustomerand theCustomerDrafthave the same set of stores, then no update actions are needed and hence an emptyListis returned.Note: Null values of the stores are filtered out.
- Parameters:
 oldStores- the stores which should be updated.newStores- the stores where we get the new store.- Returns:
 - A list containing the update actions or an empty list if the store references are identical.
 
 
- 
buildAllAddressUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildAllAddressUpdateActions(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares the addresses of aCustomerand aCustomerDraft. It returns aListofUpdateAction<Customer> as a result. If both theCustomerand theCustomerDrafthave the same set of addresses, then no update actions are needed and hence an emptyListis returned.- Parameters:
 oldCustomer- the customer which should be updated.newCustomer- the customer draft where we get the new data.- Returns:
 - A list of customer address-related update actions.
 
 
- 
buildRemoveAddressUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildRemoveAddressUpdateActions(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomerDraft.getAddresses()and aCustomer.getAddresses(). It returns aListofRemoveAddressupdate actions as a result, if the old address needs to be removed from theoldCustomerto have the same set of addresses as thenewCustomer. If both theCustomerand theCustomerDrafthave the same set of addresses, then no update actions are needed and hence an emptyListis returned.Notes:
- Addresses are matching by their keys.
 - Null values of the new addresses are filtered out.
 - Address values without keys are filtered out.
 
- Parameters:
 oldCustomer- the customer which should be updated.newCustomer- the customer draft where we get the new addresses.- Returns:
 - A list containing the update actions or an empty list if the addresses are identical.
 
 
- 
buildChangeAddressUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildChangeAddressUpdateActions(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomerDraft.getAddresses()and aCustomer.getAddresses(). It returns aListofChangeAddressupdate actions as a result, if the old address needs to be changed/updated from theoldCustomerto have the same set of addresses as thenewCustomer. If both theCustomerand theCustomerDrafthave the same set of addresses, then no update actions are needed and hence an emptyListis returned.Notes:
- Addresses are matching by their keys.
 - Null values of the new addresses are filtered out.
 - Address values without keys are filtered out.
 
- Parameters:
 oldCustomer- the customer which should be updated.newCustomer- the customer draft where we get the new addresses.- Returns:
 - A list containing the update actions or an empty list if the addresses are identical.
 
 
- 
buildAddAddressUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildAddAddressUpdateActions(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomerDraft.getAddresses()and aCustomer.getAddresses(). It returns aListofAddAddressupdate actions as a result, if the new address needs to be added to have the same set of addresses as thenewCustomer. If both theCustomerand theCustomerDrafthave the same set of addresses, then no update actions are needed and hence an emptyListis returned.Notes:
- Addresses are matching by their keys.
 - Null values of the new addresses are filtered out.
 - Address values without keys are filtered out.
 
- Parameters:
 oldCustomer- the customer which should be updated.newCustomer- the customer draft where we get the new addresses.- Returns:
 - A list containing the update actions or an empty list if the addresses are identical.
 
 
- 
buildSetDefaultShippingAddressUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetDefaultShippingAddressUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theCustomer.getDefaultShippingAddress()andCustomerDraft.getDefaultShippingAddress(). If they are different - returnSetDefaultShippingAddressupdate action. If the old shipping address is set, but the new one is empty - the command will unset the default shipping address.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft with new default shipping address.- Returns:
 - An optional with 
SetDefaultShippingAddressupdate action. 
 
- 
buildSetDefaultBillingAddressUpdateAction
@Nonnull public static java.util.Optional<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildSetDefaultBillingAddressUpdateAction(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theCustomer.getDefaultBillingAddress()andCustomerDraft.getDefaultBillingAddress(). If they are different - returnSetDefaultBillingAddressupdate action. If the old billing address id value is set, but the new one is empty - the command will unset the default billing address.- Parameters:
 oldCustomer- the customer that should be updated.newCustomer- the customer draft with new default billing address.- Returns:
 - An optional with 
SetDefaultBillingAddressupdate action. 
 
- 
buildAddShippingAddressUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildAddShippingAddressUpdateActions(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomer.getShippingAddresses()and aCustomerDraft.getShippingAddresses(). It returns aListofAddShippingAddressIdupdate actions as a result, if the new shipping address needs to be added to have the same set of addresses as thenewCustomer. If both theCustomerand theCustomerDrafthave the same set of shipping addresses, then no update actions are needed and hence an emptyListis returned.Notes:
- Addresses are matching by their keys.
 - Old address values without keys are filtered out.
 - Each address in the new addresses list satisfies the following conditions:
       
- It is not null
 - It has a key which is not blank (null/empty)
 
IllegalArgumentExceptionwill be thrown. 
- Parameters:
 oldCustomer- the customer which should be updated.newCustomer- the customer draft where we get the new shipping addresses.- Returns:
 - A list containing the update actions or an empty list if the shipping addresses are identical.
 
 
- 
buildRemoveShippingAddressUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildRemoveShippingAddressUpdateActions(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomer.getShippingAddresses()and aCustomerDraft.getShippingAddresses(). It returns aListofRemoveShippingAddressIdupdate actions as a result, if the old shipping address needs to be removed to have the same set of addresses as thenewCustomer. If both theCustomerand theCustomerDrafthave the same set of shipping addresses, then no update actions are needed and hence an emptyListis returned.Notes:
- Addresses are matching by their keys.
 - Old shipping addresses without keys will be removed.
 - Each address in the new addresses list satisfies the following conditions:
       
- It exists in the given index.
 - It has a key which is not blank (null/empty)
 
IllegalArgumentExceptionwill be thrown. 
- Parameters:
 oldCustomer- the customer which should be updated.newCustomer- the customer draft where we get the new shipping addresses.- Returns:
 - A list containing the update actions or an empty list if the shipping addresses are identical.
 
 
- 
buildAddBillingAddressUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildAddBillingAddressUpdateActions(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomer.getBillingAddresses()and aCustomerDraft.getBillingAddresses(). It returns aListofAddBillingAddressIdupdate actions as a result, if the new billing address needs to be added to have the same set of addresses as thenewCustomer. If both theCustomerand theCustomerDrafthave the same set of billing addresses, then no update actions are needed and hence an emptyListis returned.Notes:
- Addresses are matching by their keys.
 - Old address values without keys are filtered out.
 - Each address in the new addresses list satisfies the following conditions:
       
- It is not null
 - It has a key which is not blank (null/empty)
 
IllegalArgumentExceptionwill be thrown. 
- Parameters:
 oldCustomer- the customer which should be updated.newCustomer- the customer draft where we get the new billing addresses.- Returns:
 - A list containing the update actions or an empty list if the billing addresses are identical.
 
 
- 
buildRemoveBillingAddressUpdateActions
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.customers.Customer>> buildRemoveBillingAddressUpdateActions(@Nonnull io.sphere.sdk.customers.Customer oldCustomer, @Nonnull io.sphere.sdk.customers.CustomerDraft newCustomer)Compares theListof aCustomer.getBillingAddresses()and aCustomerDraft.getBillingAddresses(). It returns aListofRemoveBillingAddressIdupdate actions as a result, if the old billing address needs to be removed to have the same set of addresses as thenewCustomer. If both theCustomerand theCustomerDrafthave the same set of billing addresses, then no update actions are needed and hence an emptyListis returned.Notes:
- Addresses are matching by their keys.
 - Null values of the old addresses are filtered out.
 - Old shipping address values without keys are filtered out.
 - Each address in the new addresses list satisfies the following conditions:
       
- It exists in the given index.
 - It has a key which is not blank (null/empty)
 
IllegalArgumentExceptionwill be thrown. 
- Parameters:
 oldCustomer- the customer which should be updated.newCustomer- the customer draft where we get the new shipping addresses.- Returns:
 - A list containing the update actions or an empty list if the shipping addresses are identical.
 
 
 - 
 
 -