You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "EndzeitBegins (via GitHub)" <gi...@apache.org> on 2024/01/07 15:09:01 UTC
[PR] NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder [nifi]
EndzeitBegins opened a new pull request, #8211:
URL: https://github.com/apache/nifi/pull/8211
<!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
<!-- contributor license agreements. See the NOTICE file distributed with -->
<!-- this work for additional information regarding copyright ownership. -->
<!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
<!-- (the "License"); you may not use this file except in compliance with -->
<!-- the License. You may obtain a copy of the License at -->
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
<!-- Unless required by applicable law or agreed to in writing, software -->
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
<!-- See the License for the specific language governing permissions and -->
<!-- limitations under the License. -->
# Summary
[NIFI-12573](https://issues.apache.org/jira/browse/NIFI-12573)
Lowers type restrictions on three methods in `PropertyDescriptor.Builder` to allow both with `DescribedValue` instead of child class `AllowableValue` and with both `Enum` classes that do and do not implement `DescribedValue`.
Also addresses [NIFI-12574](https://issues.apache.org/jira/browse/NIFI-12574) by adding a new method `clearDefaultValue` to `PropertyDescriptor.Builder`.
Adds several test cases for the affected code.
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
### Pull Request Tracking
- [x] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
- [x] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
### Pull Request Formatting
- [x] Pull Request based on current revision of the `main` branch
- [x] Pull Request refers to a feature branch with one commit containing changes
# Verification
Please indicate the verification steps performed prior to pull request creation.
### Build
- [ ] Build completed using `mvn clean install -P contrib-check`
- [ ] JDK 21
### Licensing
- [x] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
- [x] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
### Documentation
- [x] Documentation formatting appears as expected in rendered files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder [nifi]
Posted by "EndzeitBegins (via GitHub)" <gi...@apache.org>.
EndzeitBegins commented on PR #8211:
URL: https://github.com/apache/nifi/pull/8211#issuecomment-1892753997
As always, thank you for input and taking on the merge process @exceptionfactory. 🙂👍🏻
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder [nifi]
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory closed pull request #8211: NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder
URL: https://github.com/apache/nifi/pull/8211
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder [nifi]
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on PR #8211:
URL: https://github.com/apache/nifi/pull/8211#issuecomment-1892750763
Thanks for the quick reply @EndzeitBegins. That's a very good point about the second scenario, and the first one is also reasonable. With that background, I agree with the changes and will proceed with merging. +1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder [nifi]
Posted by "EndzeitBegins (via GitHub)" <gi...@apache.org>.
EndzeitBegins commented on PR #8211:
URL: https://github.com/apache/nifi/pull/8211#issuecomment-1892742398
Thanks for the questions @exceptionfactory.
First of all I agree that it should be preferred to let the enums implement `DescribedValue` whenever feasible.
Maybe that's something worth to better highlight in the code documentation.
In particular I thought about two situations, where the more adaptive approach introduced in this PR would be beneficial.
1. There might be cases we're an existing enum (e.g. from a library) is used that cannot be altered. Even though I'd personally prefer creating one's own enum (implementing DescribedValue) that maps to the library one (similar to the azure bundle) I can see how someone might not want to go "the extra mile".
2. And by far more important to me, I noticed that when using the existing `public <E extends Enum<E>> Builder allowableValues(final E[] values)` with an enum that actually implements DescribedValue, those values will be ignored, which might come as a surprise.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org