CE-604 add method newForEnum

This commit is contained in:
2023-10-27 14:33:53 -05:00
parent 2fcb0106d2
commit ee66eae2a0

View File

@ -92,6 +92,21 @@ public class QPossibleValueSource implements TopLevelMetaDataInterface
/*******************************************************************************
** Create a new possible value source, for an enum, with default settings.
** e.g., type=ENUM; name from param values from the param; LABEL_ONLY format
*******************************************************************************/
public static <T extends PossibleValueEnum<?>> QPossibleValueSource newForEnum(String name, T[] values)
{
return new QPossibleValueSource()
.withName(name)
.withType(QPossibleValueSourceType.ENUM)
.withValuesFromEnum(values)
.withValueFormatAndFields(PVSValueFormatAndFields.LABEL_ONLY);
}
/*******************************************************************************
**
*******************************************************************************/