public final class AddEnumValue extends UpdateActionImpl<ProductType>
See also ProductTypeUpdateCommand.
withUpdateableProductType(client(), productType -> { final String attributeName = "size"; assertThat(productType.findAttribute(attributeName)).isPresent(); final EnumValue value = EnumValue.of("XXXL", "XXXL"); final ProductType updatedProductType = client().executeBlocking(ProductTypeUpdateCommand.of(productType, AddEnumValue.of(attributeName, value))); assertThat(updatedProductType.getAttribute(attributeName).getAttributeType()) .isInstanceOf(EnumAttributeType.class) .matches(type -> ((EnumAttributeType) type).getValues().contains(value)); return updatedProductType; });
See the test code.
EnumAttributeType.getValues()
Modifier and Type | Method and Description |
---|---|
String |
getAttributeName() |
EnumValue |
getValue() |
static AddEnumValue |
of(String attributeName,
EnumValue value) |
getAction
public static AddEnumValue of(String attributeName, EnumValue value)
public String getAttributeName()
public EnumValue getValue()