public final class ChangeInputHint extends UpdateActionImpl<ProductType>
See also ProductTypeUpdateCommand.
final String key = randomKey(); final String attributeName = "stringAttribute"; final AttributeDefinition attributeDefinition = AttributeDefinitionBuilder .of(attributeName, randomSlug(), StringAttributeType.of()) .inputHint(TextInputHint.SINGLE_LINE) .build(); final List<AttributeDefinition> attributes = singletonList(attributeDefinition); withUpdateableProductType(client(), () -> ProductTypeDraft.of(key, key, key, attributes), productType -> { assertThat(productType.getAttribute(attributeName).getInputHint()).isEqualTo(TextInputHint.SINGLE_LINE); final ProductTypeUpdateCommand cmd = ProductTypeUpdateCommand.of(productType, ChangeInputHint.of(attributeName, TextInputHint.MULTI_LINE)); final ProductType updatedProductType = client().executeBlocking(cmd); assertThat(updatedProductType.getAttribute(attributeName).getInputHint()).isEqualTo(TextInputHint.MULTI_LINE); return updatedProductType; });
See the test code.
Modifier | Constructor and Description |
---|---|
protected |
ChangeInputHint(String attributeName,
TextInputHint newValue) |
Modifier and Type | Method and Description |
---|---|
String |
getAttributeName() |
TextInputHint |
getNewValue() |
static ChangeInputHint |
of(String attributeName,
TextInputHint newValue) |
getAction
protected ChangeInputHint(String attributeName, TextInputHint newValue)
public static ChangeInputHint of(String attributeName, TextInputHint newValue)
public String getAttributeName()
public TextInputHint getNewValue()