steffenvan commented on code in PR #1354:
URL: https://github.com/apache/jackrabbit-oak/pull/1354#discussion_r1517455019


##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/IndexerSupport.java:
##########
@@ -230,4 +233,15 @@ public Set<String> 
getPreferredPathElements(Set<IndexDefinition> indexDefinition
     public <T> Predicate<T> getFilterPredicate(Set<IndexDefinition> 
indexDefinitions, Function<T, String> typeToRepositoryPath) {
         return t -> indexDefinitions.stream().anyMatch(indexDef -> 
indexDef.getPathFilter().filter(typeToRepositoryPath.apply(t)) != 
PathFilter.Result.EXCLUDE);
     }
+
+    /**
+     *
+     * @param pattern Pattern for a custom excludes regex based on which paths 
would be filtered out
+     * @param typeToRepositoryPath Function to convert type <T> to valid 
repository path of type <String>
+     * @param <T>
+     * @return filter predicate based on a matcher for a custom excludes regex 
based on which paths would be filtered out
+     */
+    public <T> Predicate<T> getFilterPredicateBasedOnCustomRegex(Pattern 
pattern, Function<T, String> typeToRepositoryPath) {

Review Comment:
   Could you write a comment about what this function is supposed to do? After 
looking at it shortly, I'm still not 100 % sure what problem it solves and why. 
Would also like an example in the Javadocs.



-- 
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: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to