turcsanyip commented on a change in pull request #4213: NIFI-7280 Use Atlas 
metadata namespace in Atlas Reporting Task
URL: https://github.com/apache/nifi/pull/4213#discussion_r409506936
 
 

 ##########
 File path: 
nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/StringSelector.java
 ##########
 @@ -0,0 +1,89 @@
+/*
+ * 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.util;
+
+/**
+ * Fluent api for checking one or more strings and selecting the first 
non-empty one.
+ * <br/><br/>
+ * {@link #toString()} returns the first encountered non-empty string or "".
+ * <p>
+ * Optimized so that no intermediary objects are created, only one, once the 
first non-empty string is found.
+ */
+public interface StringSelector {
 
 Review comment:
   Apache Commons Lang3 `StringUtils.firstNonEmpty(T... values) / 
firstNonBlank(T... values)` would be fair enough for the current use case.
   It is an interesting approach nevertheless. So we can keep it as an 
alternative solution.
   
   
   

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