You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Lehel Boér (Jira)" <ji...@apache.org> on 2022/04/19 16:33:00 UTC

[jira] [Created] (NIFI-9936) Add more support to use enums as AllowableValues in PropertyDescriptors

Lehel Boér created NIFI-9936:
--------------------------------

             Summary: Add more support to use enums as AllowableValues in PropertyDescriptors
                 Key: NIFI-9936
                 URL: https://issues.apache.org/jira/browse/NIFI-9936
             Project: Apache NiFi
          Issue Type: Improvement
            Reporter: Lehel Boér
            Assignee: Lehel Boér


With the current _PropertyDescriptor_ _builder_ implementation we can only use _enum_ names.

 
{code:java}
public <E extends Enum<E>> Builder allowableValues(final E[] values) {
    if (null != values) {
        this.allowableValues = new ArrayList<>();
        for (final E value : values) {
            allowableValues.add(new AllowableValue(value.name(), value.name()));
        }
    }
    return this;
} {code}
We should add an option to be able to pass an enum class as _allowableValues_ to the _builder_ with _displayName_ and _description_ as well.

 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)