@Generated(value="io.sphere.sdk.annotations.processors.generators.UpdateActionsGenerator", comments="Generated from: io.sphere.sdk.customers.Customer") public final class SetKey extends UpdateActionImpl<Customer>
key
property of a Customer
.
withCustomer(client(), customer -> { String newKey = randomKey(); assertThat(customer.getKey()).isNotEqualTo(newKey); final Customer updatedCustomer = client().executeBlocking(CustomerUpdateCommand.of(customer, SetKey.of(newKey))); assertThat(updatedCustomer.getKey()).isEqualTo(newKey); });
See the test code.
Customer.getKey()
Modifier and Type | Method and Description |
---|---|
String |
getKey() |
static SetKey |
of(String key)
Creates a new update action from the given parameters.
|
static SetKey |
ofUnset()
Creates a new update action to unset the
key property. |
getAction
public static SetKey of(@Nullable String key)
key
- the key
property Customer.getKey()
.SetKey
update action.public static SetKey ofUnset()
key
property.SetKey
update action.