public final class AddLocalizedEnumValue extends UpdateActionImpl<Type>
LocalizedEnumValue
value to an LocalizedEnumFieldType
field.
See also TypeUpdateCommand.
withUpdateableType(client(), type -> { final String name = TypeFixtures.LOCALIZED_ENUM_FIELD_NAME; final LocalizedEnumValue newLocalizedEnumValue = LocalizedEnumValue.of("key-new", en("label new")); final Type updatedType = client().executeBlocking(TypeUpdateCommand.of(type, AddLocalizedEnumValue.of(name, newLocalizedEnumValue))); assertThat(updatedType.getFieldDefinitionByName(name).getType()) .isInstanceOf(LocalizedEnumFieldType.class) .matches(fieldType -> ((LocalizedEnumFieldType) fieldType).getValues().contains(newLocalizedEnumValue), "contains the new enum value"); return updatedType; });
See the test code.
LocalizedEnumFieldType.getValues()
Modifier and Type | Method and Description |
---|---|
String |
getFieldName() |
LocalizedEnumValue |
getValue() |
static AddLocalizedEnumValue |
of(String fieldName,
LocalizedEnumValue value) |
getAction
public static AddLocalizedEnumValue of(String fieldName, LocalizedEnumValue value)
public String getFieldName()
public LocalizedEnumValue getValue()