Re: [PR] NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder [nifi]

2024-01-15 Thread via GitHub


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-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder [nifi]

2024-01-15 Thread via GitHub


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-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder [nifi]

2024-01-15 Thread via GitHub


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-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder [nifi]

2024-01-15 Thread via GitHub


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 > 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-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] NIFI-12573 Improve support for Enum values in PropertyDescriptor.Builder [nifi]

2024-01-07 Thread via GitHub


EndzeitBegins opened a new pull request, #8211:
URL: https://github.com/apache/nifi/pull/8211

   
   
   
   
   
   
   
   
   
   
   
   
   
   # 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-0`
   - [x] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-0`
   
   ### 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-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org