public final class AddBillingAddressId extends UpdateActionImpl<Customer>
Customer.getAddresses()
- referred to by its `id` - to Customer.getBillingAddressIds()
.
See also CustomerInStoreUpdateCommand.
final List<Address> addresses = asList(Address.of(DE), Address.of(FR)); final CustomerDraft draft = newCustomerDraft().withAddresses(addresses); withCustomer(client(), draft, customer -> { assertThat(customer.getBillingAddressIds()).isEmpty(); final Address addressForBilling = customer.getAddresses().get(1); final String addressId = addressForBilling.getId(); final AddBillingAddressId updateAction = AddBillingAddressId.of(addressId); final Customer updatedCustomer = client().executeBlocking(CustomerUpdateCommand.of(customer, updateAction)); assertThat(updatedCustomer.getBillingAddressIds()).containsExactly(addressId); });
See the test code.
Customer
Modifier and Type | Method and Description |
---|---|
String |
getAddressId() |
String |
getAddressKey() |
static AddBillingAddressId |
of(String addressId) |
static AddBillingAddressId |
ofKey(String addressKey) |
getAction
public static AddBillingAddressId of(String addressId)
public static AddBillingAddressId ofKey(String addressKey)
public String getAddressId()
public String getAddressKey()