plusone-commons 重构,代码随之重构调整。

This commit is contained in:
2023-02-24 17:30:18 +08:00
parent 9293ba6817
commit a0b16afde2
33 changed files with 91 additions and 97 deletions

View File

@@ -1,6 +1,6 @@
package xyz.zhouxy.plusone.constant;
import xyz.zhouxy.plusone.util.Enumeration;
import xyz.zhouxy.plusone.commons.util.Enumeration;
/**
* 实体状态

View File

@@ -1,36 +0,0 @@
package xyz.zhouxy.plusone.util;
import java.util.regex.Pattern;
public class RegexUtil {
private RegexUtil() {
throw new IllegalStateException("Utility class");
}
public static boolean matches(CharSequence input, String regex) {
return Pattern.matches(regex, input);
}
public static boolean matchesOr(CharSequence input, String... regexs) {
boolean isMatched;
for (var regex : regexs) {
isMatched = Pattern.matches(regex, input);
if (isMatched) {
return true;
}
}
return false;
}
public static boolean matchesAnd(CharSequence input, String... regexs) {
boolean isMatched;
for (var regex : regexs) {
isMatched = Pattern.matches(regex, input);
if (!isMatched) {
return false;
}
}
return true;
}
}