依赖 commons-lang3。

This commit is contained in:
2023-05-08 21:56:45 +08:00
parent be3caf14ec
commit f54b2d3cc6
9 changed files with 100 additions and 213 deletions

View File

@@ -33,7 +33,7 @@ public abstract class ValidatableStringRecord {
protected ValidatableStringRecord(String value, Pattern pattern) {
Assert.notNull(pattern, "The pattern must not be null.");
Assert.hasText(value, "The value must be has text.");
Assert.isNotBlank(value, "The value must be has text.");
Assert.isTrue(pattern.matcher(value).matches());
this.value = value;
}