com.github.commons.utils.validation.phone.PhoneValidation Maven / Gradle / Ivy
package com.github.commons.utils.validation.phone;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;
@Documented
@Constraint(
validatedBy = {PhoneValidationImpl.class}
)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface PhoneValidation {
boolean required() default true;
String message() default "手机号码格式错误";
Class>[] groups() default { };
Class extends Payload>[] payload() default { };
}