You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "endzeit (Jira)" <ji...@apache.org> on 2024/01/16 07:31:00 UTC
[jira] [Created] (NIFI-12613) Align type-safe access to allowableValue with it's declaration
endzeit created NIFI-12613:
------------------------------
Summary: Align type-safe access to allowableValue with it's declaration
Key: NIFI-12613
URL: https://issues.apache.org/jira/browse/NIFI-12613
Project: Apache NiFi
Issue Type: Improvement
Reporter: endzeit
Assignee: endzeit
NIFI-12452 introduced a new method on {{PropertyValue}} to type-safely access a property with allowableValues constrained by an Enum.
{code:java}
<E extends Enum<E> & DescribedValue> E asDescribedValue(Class<E> enumType) throws IllegalArgumentException {code}
I think it makes sense to align the access site in {{PropertyValue}} with the declaration site in {{PropertyDescriptor.Builder}}.
This would involve renaming the method to {{asAllowableValue}} for improved symmetry.
This is a breaking change, however the method was never part of an stable release.
Additionally, NIFI-12573 unified the behaviour of specifying Enums (not) implementing {{DescribedValue}} as allowableValues. With this change in place, I think it's reasonable to open the method to accepts any Enum as well.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)