EndzeitBegins commented on code in PR #8102:
URL: https://github.com/apache/nifi/pull/8102#discussion_r1412736232


##########
nifi-api/src/main/java/org/apache/nifi/components/PropertyDescriptor.java:
##########
@@ -313,6 +313,27 @@ public Builder defaultValue(final String value) {
             return this;
         }
 
+        /**
+         * Specifies the initial value and the default value that will be used
+         * if the user does not specify a value. When {@link #build()} is
+         * called, if Allowable Values have been set (see
+         * {@link #allowableValues(AllowableValue...)})
+         * and the "Value" of the {@link DescribedValue} object is not
+         * the "Value" of one of those Allowable Values, an Exception will be 
thrown.
+         * If the Allowable Values have been set using the
+         * {@link #allowableValues(AllowableValue...)} method, the default 
value
+         * should be set providing the {@link AllowableValue} to this method.
+         *
+         * @param describedValue default value holder
+         * @return the builder
+         */
+        public Builder defaultDescribedValue(final DescribedValue 
describedValue) {

Review Comment:
   Yes, this was my initial idea as well. However, this prohibits the user of 
`.defaultValue(null)` as the compiler cannot differentiate in that case. 
   If we're okay with that, I'm more than happy to make it an overloaded 
method. What do you think?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to