1 package com.atlassian.user.search.query.match;
2
3 import org.apache.commons.lang.StringUtils;
4
5 /**
6 * Matches if <code>content.startsWith(searchTerm)</code> returns true after the arguments have been converted to lower
7 * case. If either argument is null or the content is an empty string (""), returns false.
8 */
9 public class StartsWithIgnoreCaseMatcher implements Matcher
10 {
11 public boolean matches(String content, String searchTerm)
12 {
13 if (StringUtils.isBlank(content) || searchTerm == null)
14 return false;
15 return content.toLowerCase().startsWith(searchTerm.toLowerCase());
16 }
17 }