tpalfy commented on code in PR #7191:
URL: https://github.com/apache/nifi/pull/7191#discussion_r1185266560


##########
nifi-api/src/main/java/org/apache/nifi/flowanalysis/ComponentAnalysisResult.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.flowanalysis;
+
+/**
+ * Holds information about a component violating a {@link FlowAnalysisRule}
+ */
+public class ComponentAnalysisResult extends AbstractAnalysisResult {
+    private ComponentAnalysisResult(String issueId, String message, String 
explanation) {
+        super(issueId, message, explanation);
+    }
+
+    /**
+     * @param issueId A rule-defined id that corresponds to a unique type of 
issue recognized by the rule.
+     *                Newer analysis runs may produce a result with the same 
issueId in which case the old one will
+     *                be overwritten (or recreated if it is the same in other 
aspects as well).
+     *                However, if the previous result was disabled the new one 
will be disabled as well.
+     * @param message A violation message
+     * @return a new result instance
+     */
+    public static ComponentAnalysisResult newResult(String issueId, String 
message) {

Review Comment:
   I can change them to simple constructors. A builder feels overcomplicated in 
this case, especially when there is only one non-mandatory parameter and only 2 
different ways of creating a proper instance.



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