dan-s1 commented on code in PR #8417:
URL: https://github.com/apache/nifi/pull/8417#discussion_r1511285858


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncodeContent.java:
##########
@@ -237,4 +297,14 @@ public void process(final InputStream in, final 
OutputStream out) throws IOExcep
             out.flush();
         }
     }
+
+    private static EncodingType getEncodingTypeFromString(final String 
encodingTypeValue) {
+        if (encodingTypeValue.compareToIgnoreCase("base64") == 0) {
+            return EncodingType.BASE64;
+        } else if (encodingTypeValue.compareToIgnoreCase("base32") == 0) {
+            return EncodingType.BASE32;

Review Comment:
   No need to hard code the values again when they are already defined in the 
`EncodingType` enum. Also, ignoring the case  I do not believe  is needed at 
least from UI  since the values to choose from are only the ones in the 
`EncodingType` enum. If it is still needed (perhaps if the processor is 
manipulated through the REST API) then simply use `equalsIgnoreCase`.
   
   ```suggestion
           if (EncodingType.BASE64.getValue().equals(encodingTypeValue)) {
               return EncodingType.BASE64;
           } else if (EncodingType.BASE32.getValue().equals(encodingTypeValue)) 
{
               return EncodingType.BASE32;
   ```



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