mosermw commented on code in PR #9583:
URL: https://github.com/apache/nifi/pull/9583#discussion_r1888755297
##########
nifi-extension-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongoRecord.java:
##########
@@ -79,35 +77,29 @@ public class GetMongoRecord extends
AbstractMongoQueryProcessor {
.required(true)
.build();
- private static final List<PropertyDescriptor> DESCRIPTORS;
- private static final Set<Relationship> RELATIONSHIPS;
-
- static {
- List<PropertyDescriptor> _temp = new ArrayList<>();
- _temp.add(CLIENT_SERVICE);
- _temp.add(WRITER_FACTORY);
- _temp.add(DATABASE_NAME);
- _temp.add(COLLECTION_NAME);
- _temp.add(SCHEMA_NAME);
- _temp.add(QUERY_ATTRIBUTE);
- _temp.add(QUERY);
- _temp.add(PROJECTION);
- _temp.add(SORT);
- _temp.add(LIMIT);
- _temp.add(BATCH_SIZE);
-
- DESCRIPTORS = Collections.unmodifiableList(_temp);
-
- Set<Relationship> _rels = new HashSet<>();
- _rels.add(REL_SUCCESS);
- _rels.add(REL_FAILURE);
- _rels.add(REL_ORIGINAL);
- RELATIONSHIPS = Collections.unmodifiableSet(_rels);
- }
+ private static final List<PropertyDescriptor> PROPERTIES = Stream.of(
Review Comment:
Hi @dan-s1 I'm curious why you sometimes chose to use Stream.of() instead of
List.of()? I understand using Stream when an argument is a collection itself,
but this instance and some others appear to be better suited to List.of().
--
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]