code: public static Rule getRule(final String field, final String pattern) {
      try {
          return new LikeRule(field, Pattern.compile(pattern, Pattern.CASE_INSENSITIVE));
      } catch (PatternSyntaxException e) {
          throw new IllegalArgumentException(
                  "Invalid LIKE rule - " + e.getMessage());
      }
    }
docs: Create new instance.
  @param field field
  @param pattern pattern
  @return new instance