Package org.aoju.bus.validate.annotation
Annotation Interface InEnum
@Documented
@Retention(RUNTIME)
@Target({ANNOTATION_TYPE,METHOD,PARAMETER,FIELD})
@Complex(value="InEnum",
clazz=InEnumStrategy.class)
public @interface InEnum
校验对象在枚举中,默认将对象与枚举名称匹配
默认被校验对象是null时,通过校验
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
enumClass
枚举类型- Returns:
- the object
-
method
String method枚举中的方法,将枚举方法的结果与被校验参数进行equals判断校验结果- Returns:
- the string
- Default:
"name"
-
errcode
String errcode默认使用的异常码- Returns:
- the string
- Default:
"-1"
-
errmsg
String errmsg默认使用的异常信息- Returns:
- the string
- Default:
"${field}\u5fc5\u987b\u5c5e\u4e8e\u6307\u5b9a\u679a\u4e3e\u7c7b\u578b:${enumClass}"
-
group
String[] group校验器组- Returns:
- the array
- Default:
{}
-
field
String field被校验字段名称- Returns:
- the string
- Default:
"field"
-