dengzedong
2024-12-24 aa0382e44311f9f7e62a688c8fcaa9c69a512e0f
提交 | 用户 | 时间
e7c126 1 package com.iailab.framework.common.validation;
H 2
3 import com.iailab.framework.common.core.IntArrayValuable;
4
5 import javax.validation.Constraint;
6 import javax.validation.Payload;
7 import java.lang.annotation.*;
8
9 @Target({
10         ElementType.METHOD,
11         ElementType.FIELD,
12         ElementType.ANNOTATION_TYPE,
13         ElementType.CONSTRUCTOR,
14         ElementType.PARAMETER,
15         ElementType.TYPE_USE
16 })
17 @Retention(RetentionPolicy.RUNTIME)
18 @Documented
19 @Constraint(
20         validatedBy = {InEnumValidator.class, InEnumCollectionValidator.class}
21 )
22 public @interface InEnum {
23
24     /**
25      * @return 实现 EnumValuable 接口的
26      */
27     Class<? extends IntArrayValuable> value();
28
29     String message() default "必须在指定范围 {value}";
30
31     Class<?>[] groups() default {};
32
33     Class<? extends Payload>[] payload() default {};
34
35 }