ValidateUtil 重命名为 ValidTools。

This commit is contained in:
zhouxy108 2025-02-18 22:23:19 +08:00
parent 25ec5577cc
commit 5bb6351c5b
4 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ package xyz.zhouxy.plusone.validator;
* *
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a> * @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
* *
* @see ValidateUtil * @see ValidTools
* @see BaseValidator * @see BaseValidator
*/ */
public interface IValidateRequired { public interface IValidateRequired {

View File

@ -12,8 +12,8 @@ package xyz.zhouxy.plusone.validator;
* @see Validator * @see Validator
* @see IValidateRequired * @see IValidateRequired
*/ */
public class ValidateUtil { public class ValidTools {
private ValidateUtil() { private ValidTools() {
throw new IllegalStateException("Utility class"); throw new IllegalStateException("Utility class");
} }

View File

@ -20,7 +20,7 @@ import java.util.function.Supplier;
* *
* <p> * <p>
* 然后通过校验器的 {@link #validate} 方法 * 然后通过校验器的 {@link #validate} 方法
* {@link ValidateUtil#validate(Object, Validator)} 对指定对象进行校验 * {@link ValidTools#validate(Object, Validator)} 对指定对象进行校验
* </p> * </p>
* *
* <pre> * <pre>
@ -28,13 +28,13 @@ import java.util.function.Supplier;
* </pre> * </pre>
* *
* <pre> * <pre>
* ValidateUtil.validate(255, validator); * ValidTools.validate(255, validator);
* </pre> * </pre>
* </p> * </p>
* *
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a> * @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
* @see IValidateRequired * @see IValidateRequired
* @see ValidateUtil * @see ValidTools
* @see BaseValidator * @see BaseValidator
*/ */
public final class Validator<T> extends BaseValidator<T> { public final class Validator<T> extends BaseValidator<T> {

View File

@ -11,7 +11,7 @@ import xyz.zhouxy.plusone.commons.constant.PatternConsts;
import xyz.zhouxy.plusone.commons.function.PredicateTools; import xyz.zhouxy.plusone.commons.function.PredicateTools;
import xyz.zhouxy.plusone.commons.util.RegexTools; import xyz.zhouxy.plusone.commons.util.RegexTools;
import xyz.zhouxy.plusone.validator.BaseValidator; import xyz.zhouxy.plusone.validator.BaseValidator;
import xyz.zhouxy.plusone.validator.ValidateUtil; import xyz.zhouxy.plusone.validator.ValidTools;
class BaseValidatorTest { class BaseValidatorTest {
@Test @Test
@ -21,7 +21,7 @@ class BaseValidatorTest {
"A1b2C3d4", "A1b2C3d4",
Arrays.asList(new String[] { "admin", "editor" })); Arrays.asList(new String[] { "admin", "editor" }));
RegisterCommandValidator.INSTANCE.validate(registerCommand); RegisterCommandValidator.INSTANCE.validate(registerCommand);
ValidateUtil.validate(registerCommand, RegisterCommandValidator.INSTANCE); ValidTools.validate(registerCommand, RegisterCommandValidator.INSTANCE);
System.out.println(registerCommand); System.out.println(registerCommand);
} }