You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "David Handermann (Jira)" <ji...@apache.org> on 2024/01/18 04:18:00 UTC
[jira] [Updated] (NIFI-12613) Align PropertyDescriptor asAllowableValue with Builder Declaration
[ https://issues.apache.org/jira/browse/NIFI-12613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Handermann updated NIFI-12613:
------------------------------------
Summary: Align PropertyDescriptor asAllowableValue with Builder Declaration (was: Align type-safe access to allowableValue with it's declaration )
> Align PropertyDescriptor asAllowableValue with Builder Declaration
> ------------------------------------------------------------------
>
> Key: NIFI-12613
> URL: https://issues.apache.org/jira/browse/NIFI-12613
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: endzeit
> Assignee: endzeit
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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)