public final class AddLocalizedEnumValue extends UpdateActionImpl<ProductType>
See also ProductTypeUpdateCommand.
withUpdateableProductType(client(), productType -> { final String attributeName = "color"; assertThat(productType.getAttribute(attributeName)).isNotNull(); final LocalizedEnumValue value = LocalizedEnumValue.of("brown", LocalizedString.of(Locale.ENGLISH, "brown").plus(GERMAN, "braun")); final ProductType updatedProductType = client().executeBlocking(ProductTypeUpdateCommand.of(productType, AddLocalizedEnumValue.of(attributeName, value))); assertThat(updatedProductType.getAttribute(attributeName).getAttributeType()) .isInstanceOf(LocalizedEnumAttributeType.class) .matches(type -> ((LocalizedEnumAttributeType) type).getValues().contains(value)); return updatedProductType; });
See the test code.
LocalizedEnumAttributeType.getValues()
Modifier and Type | Method and Description |
---|---|
String |
getAttributeName() |
LocalizedEnumValue |
getValue() |
static AddLocalizedEnumValue |
of(String attributeName,
LocalizedEnumValue value) |
getAction
public static AddLocalizedEnumValue of(String attributeName, LocalizedEnumValue value)
public String getAttributeName()
public LocalizedEnumValue getValue()