forked from plusone/plusone-validator
refactor!: StringPropertyValidator
的 email
方法重命名为 emailAddress
This commit is contained in:
parent
1b8a5634b3
commit
6585750e65
@ -178,28 +178,29 @@ public class StringPropertyValidator<DTO> extends BaseComparablePropertyValidato
|
|||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
// ================================
|
// ================================
|
||||||
// #region - email
|
// #region - emailAddress
|
||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
public StringPropertyValidator<DTO> email() {
|
public StringPropertyValidator<DTO> emailAddress() {
|
||||||
return email("The value is not an email address.");
|
return emailAddress("The value is not an email address.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringPropertyValidator<DTO> email(String errMsg) {
|
public StringPropertyValidator<DTO> emailAddress(String errMsg) {
|
||||||
return email(convertExceptionCreator(errMsg));
|
return emailAddress(convertExceptionCreator(errMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringPropertyValidator<DTO> email(Supplier<E> exceptionCreator) {
|
public <E extends RuntimeException> StringPropertyValidator<DTO> emailAddress(
|
||||||
return email(convertExceptionCreator(exceptionCreator));
|
Supplier<E> exceptionCreator) {
|
||||||
|
return emailAddress(convertExceptionCreator(exceptionCreator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <E extends RuntimeException> StringPropertyValidator<DTO> email(Function<String, E> exceptionCreator) {
|
public <E extends RuntimeException> StringPropertyValidator<DTO> emailAddress(
|
||||||
// TODO [优化] 优化 email 校验
|
Function<String, E> exceptionCreator) {
|
||||||
return matches(PatternConsts.EMAIL, exceptionCreator);
|
return matches(PatternConsts.EMAIL, exceptionCreator);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================================
|
// ================================
|
||||||
// #endregion - email
|
// #endregion - emailAddress
|
||||||
// ================================
|
// ================================
|
||||||
|
|
||||||
// ================================
|
// ================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user