package cn.reghao.oss.console.util.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 模仿 @NotNull
 *
 * @author reghao
 * @date 2021-06-21 17:35:07
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
@Constraint(validatedBy = EnumValidator.class)
public @interface ValidEnum {
    Class<?> value();

    String message() default "枚举类型的值不正确";

    String method() default "getName";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
