private NaturalLanguageMethodMatch match( NaturalLanguageMethod naturalLanguageMethod, String inputString) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log( Level.FINEST, "Checking " + naturalLanguageMethod.getPattern() + " for match with '" + inputString + "'"); } Matcher matcher = naturalLanguageMethod.getPattern().matcher(inputString); if (matcher.matches()) { return new NaturalLanguageMethodMatch(naturalLanguageMethod, matcher); } return null; }
private boolean isCatchAllMethod(NaturalLanguageMethod method) { return method.getPattern().pattern().equals(EVERYTHING_ELSE_REGEX); }