yangys
2024-09-04 04c57331cf84c8f606c2838dcb6fe5463fb9b68c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.qianwen.smartman.common.validator.flag;
 
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
 
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Constraint(validatedBy = {FlagValueValidator.class})
@Documented
@Retention(RetentionPolicy.RUNTIME)
 
public @interface FlagValue {
 
    @Target({ElementType.FIELD, ElementType.PARAMETER})
    @Retention(RetentionPolicy.RUNTIME)
    @Documented
    
    public @interface List {
        FlagValue[] value();
    }
 
    String message() default "不正确的flag标识,请传递Y或者N";
 
    Class[] groups() default {};
 
    Class<? extends Payload>[] payload() default {};
 
    boolean required() default true;
}