turcsanyip commented on a change in pull request #4123: NIFI-7188: Adding 
filter capabilities into search & prerequisite refactors
URL: https://github.com/apache/nifi/pull/4123#discussion_r392371549
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/search/ComponentMatcher.java
 ##########
 @@ -0,0 +1,43 @@
+/*
+ * 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.web.search;
+
+import org.apache.nifi.web.api.dto.search.ComponentSearchResultDTO;
+import org.apache.nifi.web.search.query.SearchQuery;
+
+import javax.annotation.Nonnull;
+import java.util.Optional;
+
+/**
+ * Service responsible to clamp all the possible matches for a given component 
type.
+ *
+ * @param <COMPONENT_TYPE> The component type.
+ */
+public interface ComponentMatcher<COMPONENT_TYPE> {
+
+    /**
+     * Tries to match the incoming search query against a given component with 
all the matchers are applicable for the given type.
+     *
+     * @param component The component to match against.
+     * @param query The search query to match.
+     *
+     * @return The result of the matching. {@link Optional#empty()} if there 
was no match, contains {@link ComponentSearchResultDTO}
+     * with the details of the results in case there was at least one match 
for the given component and query.
+     */
+    @Nonnull
 
 Review comment:
   I haven't seen it used in this project. Though I don't know if it is a 
convention or not. JSR305 comes in only via a transitive dependency, so I'd say 
it is intentionally not added / used.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to