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