All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.chobit.commons.validation.EnumValue Maven / Gradle / Ivy

There is a newer version: 0.1.3.4
Show newest version
package org.chobit.commons.validation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.chobit.commons.contract.CodeEnum;

import java.lang.annotation.*;

/**
 * 枚举值验证注解
 *
 * @author baifeng.sun
 */
@Documented
@Constraint(
        validatedBy = {EnumValueValidator.class}
)
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface EnumValue {


    Class[] groups() default {};


    Class[] payload() default {};

    /**
     * 枚举类型
     *
     * @return 枚举类类型
     */
    Class> enumClass();


    /**
     * 可排除的枚举值
     *
     * @return 可排除的枚举值
     */
    int[] exclude() default {};


    /**
     * 提示消息
     *
     * @return 提示消息
     */
    String message() default "非法的枚举值";
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy