public final class RemoveAttributeDefinition extends UpdateActionImpl<ProductType>
See also ProductTypeUpdateCommand.
withUpdateableProductType(client(), productType -> { //add final String attributeName = "foostring"; final AttributeDefinition foostring = AttributeDefinitionBuilder.of(attributeName, LocalizedString.of(ENGLISH, "foo string"), StringAttributeType.of()).build(); final ProductType withFoostring = client().executeBlocking(ProductTypeUpdateCommand.of(productType, AddAttributeDefinition.of(foostring))); final AttributeDefinition loadedDefinition = withFoostring.getAttribute(attributeName); assertThat(loadedDefinition.getAttributeType()).isEqualTo(StringAttributeType.of()); //remove final ProductType withoutFoostring = client().executeBlocking(ProductTypeUpdateCommand.of(withFoostring, RemoveAttributeDefinition.of(attributeName))); assertThat(withoutFoostring.findAttribute(attributeName)).isEmpty(); return withoutFoostring; });
See the test code.
Modifier and Type | Method and Description |
---|---|
String |
getName() |
static RemoveAttributeDefinition |
of(String attributeName) |
getAction
public static RemoveAttributeDefinition of(String attributeName)
public String getName()