Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-12613

Align PropertyDescriptor asAllowableValue with Builder Declaration

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-M2
    • None
    • None

    Description

      NIFI-12452 introduced a new method on PropertyValue to type-safely access a property with allowableValues constrained by an Enum. 

      <E extends Enum<E> & DescribedValue> E asDescribedValue(Class<E> enumType) throws IllegalArgumentException 

      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.

      Attachments

        Issue Links

          Activity

            People

              EndzeitBegins endzeit
              EndzeitBegins endzeit
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h