nandorsoma commented on PR #5977:
URL: https://github.com/apache/nifi/pull/5977#issuecomment-1108576774

   > @nandorsoma @exceptionfactory @tpalfy Thanks for the comments. I went over 
recommended interface names. The PropertyValue already exists so I chose the 
DescribedValue. I added the getValue() method to the interface, it can be 
overriden not only for the enum instances, but for the whole class.
   > 
   > `public enum EnumAllowableValue implements DescribedValue {
   > 
   > ```
   > GREEN {
   >     @Override
   >     public String getDisplayName() {
   >         return "GreenDisplayName";
   >     }
   > 
   >     @Override
   >     public String getDescription() {
   >         return "GreenDescription";
   >     }
   > },
   > 
   > RED {
   >     @Override
   >     public String getDisplayName() {
   >         return "RedDisplayName";
   >     }
   > 
   >     @Override
   >     public String getDescription() {
   >         return "RedDescription";
   >     }
   > };
   > 
   > @Override
   > public String getValue() {
   >     return name();
   > }
   > ```
   > 
   > }`
   
   Interesting solution, but I like it!


-- 
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

Reply via email to