umarhussain15 commented on code in PR #8610:
URL: https://github.com/apache/nifi/pull/8610#discussion_r1685540118


##########
nifi-extension-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java:
##########
@@ -159,11 +161,42 @@ public abstract class AbstractMongoProcessor extends 
AbstractProcessor {
     static final List<PropertyDescriptor> descriptors;
 
     static {
-        List<PropertyDescriptor> _temp = new ArrayList<>();
-        _temp.add(CLIENT_SERVICE);
-        _temp.add(DATABASE_NAME);
-        _temp.add(COLLECTION_NAME);
-        descriptors = Collections.unmodifiableList(_temp);
+      descriptors = List.of(CLIENT_SERVICE, DATABASE_NAME, COLLECTION_NAME);
+    }
+
+    public enum UpdateMethod implements DescribedValue {
+        UPDATE_ONE("one", "Update One", "Updates only the first document that 
matches the query."),
+        UPDATE_MANY("many", "Update Many", "Updates every document that 
matches the query."),
+        UPDATE_FF_ATTRIBUTE("flowfile-attribute", "Use '" + 
ATTRIBUTE_MONGODB_UPDATE_MODE + "' flowfile attribute.",
+            "Use the value of the '" + ATTRIBUTE_MONGODB_UPDATE_MODE + "' 
attribute of the incoming flowfile. Acceptable values are 'one' and 'many'.");
+        private final String value;
+        private final String displayName;
+        private final String description;
+
+        UpdateMethod(final String value, final String displayName, final 
String description) {
+            this.value = value;
+            this.displayName = displayName;
+            this.description = description;
+        }
+
+        @Override
+        public String getValue() {
+            return value;
+        }
+
+        @Override
+        public String getDisplayName() {
+            return displayName;
+        }
+
+        @Override
+        public String getDescription() {
+            return description;
+        }
+
+        public boolean matches(String value) {
+            return this.value.equals(value);
+        }

Review Comment:
   Thanks, I have updated it and also switched to using enum when reading 
processor property in Put processors



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