public final class SetTaxCategory extends UpdateActionImpl<Product>
See also ProductUpdateCommand.
TaxCategoryFixtures.withTransientTaxCategory(client(), taxCategory -> withUpdateableProduct(client(), product -> { assertThat(product.getTaxCategory()).isNotEqualTo(taxCategory); final ProductUpdateCommand command = ProductUpdateCommand.of(product, SetTaxCategory.of(taxCategory.toResourceIdentifier())); final Product updatedProduct = client().executeBlocking(command); assertThat(updatedProduct.getTaxCategory()).isEqualTo(taxCategory.toReference()); return updatedProduct; }) );
See the test code.
Modifier and Type | Method and Description |
---|---|
ResourceIdentifier<TaxCategory> |
getTaxCategory() |
static SetTaxCategory |
of(ResourceIdentifier<TaxCategory> taxCategory) |
static SetTaxCategory |
ofReferencable(Referenceable<TaxCategory> taxCategory)
Deprecated.
|
static SetTaxCategory |
to(Referenceable<TaxCategory> taxCategory)
Deprecated.
|
static SetTaxCategory |
unset() |
getAction
@Deprecated public static SetTaxCategory ofReferencable(@Nullable Referenceable<TaxCategory> taxCategory)
of(ResourceIdentifier)
taxCategory
- tax category to be setpublic static SetTaxCategory of(@Nullable ResourceIdentifier<TaxCategory> taxCategory)
public static SetTaxCategory unset()
@Deprecated public static SetTaxCategory to(Referenceable<TaxCategory> taxCategory)
of(ResourceIdentifier)
@Nullable public ResourceIdentifier<TaxCategory> getTaxCategory()