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