/*
* Copyright (c) 2020. ascend 版权所有禁止转载。
*/
package cn.edu.zua.springbootdemo2.util.core.validation;
import cn.edu.zua.springbootdemo2.util.core.validation.bound.IntEnumValidatorForInteger;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* 说明:The annotated element must be a number of values .
*
* @author adeng 2020/3/14 10:12
*/
@Documented
@Constraint(validatedBy = {IntEnumValidatorForInteger.class})
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(IntEnum.List.class)
public @interface IntEnum {
/**
* 合法值
*/
int[] value() default {};
String message() default "{javax.validation.constraints.IntEnum.message}";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
/**
* Defines several {@code @Email} constraints on the same element.
*
* @see IntEnum
*/
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
@Documented
@interface List {
IntEnum[] value();
}
}