ValidatableStringRecord 的值满足 Pattern 即可,不要求 not blank。

dev
ZhouXY108 2024-04-16 21:03:24 +08:00
parent b08562adaf
commit d2d760e866
1 changed files with 1 additions and 3 deletions

View File

@ -19,8 +19,6 @@ package xyz.zhouxy.plusone.commons.domain;
import java.util.Objects;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import com.google.common.base.Preconditions;
import xyz.zhouxy.plusone.commons.util.RegexTools;
@ -37,7 +35,7 @@ public abstract class ValidatableStringRecord
protected ValidatableStringRecord(String value, Pattern pattern) {
Preconditions.checkNotNull(pattern, "The pattern must not be null.");
Preconditions.checkNotNull(StringUtils.isNotBlank(value), "The value must not be null.");
Preconditions.checkNotNull(value, "The value must not be null.");
Preconditions.checkArgument(RegexTools.matches(value, pattern));
this.value = value;
}