fix: 修改 StringPropertyValidator#length 中的错误信息

This commit is contained in:
zhouxy108 2025-05-19 17:33:01 +08:00
parent 6585750e65
commit a9df6f8c0e

View File

@ -262,7 +262,8 @@ public class StringPropertyValidator<DTO> extends BaseComparablePropertyValidato
public <E extends RuntimeException> StringPropertyValidator<DTO> length(int length, public <E extends RuntimeException> StringPropertyValidator<DTO> length(int length,
Function<String, E> exceptionCreator) { Function<String, E> exceptionCreator) {
AssertTools.checkArgument(length >= 0, "The minimum value must be less than the maximum value."); AssertTools.checkArgument(length >= 0,
"The required length must be greater than or equal to 0.");
withRule(s -> s != null && s.length() == length, exceptionCreator); withRule(s -> s != null && s.length() == length, exceptionCreator);
return this; return this;
} }