org.kiwiproject.util.regex.NoMatchesFoundException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kiwi Show documentation
Show all versions of kiwi Show documentation
Kiwi is a utility library. We really like Google's Guava, and also use Apache Commons.
But if they don't have something we need, and we think it is useful, this is where we put it.
package org.kiwiproject.util.regex;
import java.util.regex.Pattern;
/**
* Exception class to indicate a regular expression match did not match.
*/
public class NoMatchesFoundException extends RuntimeException {
/**
* Create a new instance with the given message.
*
* @param message the exception message
*/
public NoMatchesFoundException(String message) {
super(message);
}
/**
* Factory method to create a new instance with a standardized message for the given {@link Pattern}.
*
* @param pattern the Pattern object
* @return a new instance
*/
public static NoMatchesFoundException forPattern(Pattern pattern) {
return new NoMatchesFoundException("No match found for pattern: " + pattern);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy