public final class ChangeLocalizedEnumValueOrder extends UpdateActionImpl<ProductType>
See also ProductTypeUpdateCommand.
withUpdateableProductType(client(), productType -> { final String attributeName = "color"; final LocalizedEnumAttributeType attributeType = (LocalizedEnumAttributeType) productType.getAttribute(attributeName) .getAttributeType(); final List<LocalizedEnumValue> values = reverse(attributeType.getValues()); final ProductType updatedProductType = client().executeBlocking(ProductTypeUpdateCommand.of(productType, ChangeLocalizedEnumValueOrder.of(attributeName, values))); final LocalizedEnumAttributeType updatedType = (LocalizedEnumAttributeType) updatedProductType.getAttribute(attributeName) .getAttributeType(); assertThat(updatedType.getValues()).isEqualTo(values); return updatedProductType; });
See the test code.
Modifier and Type | Method and Description |
---|---|
String |
getAttributeName() |
List<LocalizedEnumValue> |
getValues() |
static ChangeLocalizedEnumValueOrder |
of(String attributeName,
List<LocalizedEnumValue> values) |
getAction
public static ChangeLocalizedEnumValueOrder of(String attributeName, List<LocalizedEnumValue> values)
public String getAttributeName()
public List<LocalizedEnumValue> getValues()