View Javadoc

1   package com.atlassian.user.search.query.match;
2   
3   import org.apache.commons.lang.StringUtils;
4   
5   /**
6    * Matches if <code>content.endsWith(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 EndsWithIgnoreCaseMatcher 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().endsWith(searchTerm.toLowerCase());
16      }
17  }