@Generated(value="io.sphere.sdk.annotations.processors.generators.UpdateActionsGenerator", comments="Generated from: io.sphere.sdk.taxcategories.TaxCategory") public final class SetKey extends UpdateActionImpl<TaxCategory>
key
property of a TaxCategory
.
withUpdateableTaxCategory(client(), taxCategory -> {
final String newKey = randomKey();
assertThat(taxCategory.getKey()).isNotEqualTo(newKey);
final TaxCategory updatedTaxCategory = client().executeBlocking(TaxCategoryUpdateCommand.of(taxCategory, SetKey.of(newKey)));
assertThat(updatedTaxCategory.getKey()).isEqualTo(newKey);
return updatedTaxCategory;
});
See the test code.
TaxCategory.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 TaxCategory.getKey()
.SetKey
update action.public static SetKey ofUnset()
key
property.SetKey
update action.