Skip to content

Commit

Permalink
Add fastmatcher#compileFromList
Browse files Browse the repository at this point in the history
  • Loading branch information
kangarko committed May 11, 2024
1 parent d9bbcef commit 8f8d1ed
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/org/mineacademy/fo/model/FastMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@ else if (pattern.startsWith("* "))

return new FastMatcher(null, pattern, matchers.toArray(new Matcher[matchers.size()]));
}

/**
* Compile a list of matchers from the given list
*
* @param list
* @return
*/
public static List<FastMatcher> compileFromList(List<String> list) {
final List<FastMatcher> matchers = new ArrayList<>();

for (final String pattern : list)
matchers.add(compile(pattern));

return matchers;
}
}

@Getter
Expand Down

0 comments on commit 8f8d1ed

Please sign in to comment.