public final class ChangeIsSearchable extends UpdateActionImpl<ProductType>
See also ProductTypeUpdateCommand.
final String key = randomKey(); final String attributeName = "stringattribute"; final AttributeDefinition attributeDefinition = AttributeDefinitionBuilder .of(attributeName, randomSlug(), StringAttributeType.of()) .isSearchable(false) .build(); final List<AttributeDefinition> attributes = singletonList(attributeDefinition); withUpdateableProductType(client(), () -> ProductTypeDraft.of(key, key, key, attributes), productType -> { assertThat(productType.getAttribute(attributeName).isSearchable()).isFalse(); final ProductTypeUpdateCommand cmd = ProductTypeUpdateCommand.of(productType, ChangeIsSearchable.of(attributeName, true)); final ProductType updatedProductType = client().executeBlocking(cmd); assertThat(updatedProductType.getAttribute(attributeName).isSearchable()).isTrue(); return updatedProductType; });
See the test code.
Modifier and Type | Method and Description |
---|---|
String |
getAttributeName() |
Boolean |
isSearchable() |
static ChangeIsSearchable |
of(String attributeName,
Boolean searchable) |
getAction
public static ChangeIsSearchable of(String attributeName, Boolean searchable)
public String getAttributeName()
public Boolean isSearchable()