javax.validation.constraints.Pattern.Flag Java Examples

The following examples show how to use javax.validation.constraints.Pattern.Flag. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RegexUtil.java    From BlogManagePlatform with Apache License 2.0 5 votes vote down vote up
/**
 * 转换枚举
 * @author Frodez
 * @date 2019-03-05
 */
public static int transfer(Flag... flags) {
	if (EmptyUtil.yes(flags)) {
		throw new IllegalArgumentException();
	}
	int flag = 0;
	for (Flag item : flags) {
		flag = flag | item.getValue();
	}
	return flag;
}
 
Example #2
Source File: RegexUtil.java    From BlogManagePlatform with Apache License 2.0 2 votes vote down vote up
/**
 * 是否通过正则表达式校验
 * @author Frodez
 * @date 2019-03-05
 */
public static boolean match(String regex, String input, Flag... flags) {
	return match(regex, input, transfer(flags));
}