in data/src/main/java/com/microsoft/azure/kusto/data/auth/endpoints/FastSuffixMatcher.java [74:94]
public MatchResult match(String candidate) {
Ensure.argIsNotNull(candidate, "candidate");
if (candidate.length() < suffixLength) {
return new MatchResult(false, null);
}
List<MatchRule> matchRules = rules.get(StringUtils.getStringTail(candidate, suffixLength));
if (matchRules != null) {
for (MatchRule rule : matchRules) {
if (org.apache.commons.lang3.StringUtils.endsWithIgnoreCase(candidate, rule.suffix)) {
if (candidate.length() == rule.suffix.length()
|| !rule.exact) {
return new MatchResult(true, rule);
}
}
}
}
return new MatchResult(false, null);
}