/** * Find the patterns matching the given lookup path. Invoking this method should * yield results equivalent to those of calling * {@link #getMatchingCondition(ServerWebExchange)}. * This method is provided as an alternative to be used if no request is available * (e.g. introspection, tooling, etc). * @param lookupPath the lookup path to match to existing patterns * @return a collection of matching patterns sorted with the closest match at the top */ public List<String> getMatchingPatterns(String lookupPath) { List<String> matches = new ArrayList<>(); for (String pattern : this.patterns) { String match = getMatchingPattern(pattern, lookupPath); if (match != null) { matches.add(match); } } Collections.sort(matches, this.pathMatcher.getPatternComparator(lookupPath)); return matches; }