Annotation Interface Compare


@Target({FIELD,PARAMETER}) @Retention(RUNTIME) @Documented public @interface Compare
参数值比较验证注解
Since:
Java 17+
Author:
Kimi Liu
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    比较条件
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
    默认使用的异常码
    默认使用的异常信息
    被校验字段名称
    校验器组
  • Element Details

    • cond

      Returns:
      比较的条件
      Default:
      EQ
    • with

      String with
      Returns:
      与之比较的参数名称
    • errcode

      String errcode
      默认使用的异常码
      Returns:
      the string
      Default:
      "-1"
    • errmsg

      String errmsg
      默认使用的异常信息
      Returns:
      the string
      Default:
      "${field}\u53c2\u6570\u4e0d\u7b26\u5408\u89c4\u5219"
    • group

      String[] group
      校验器组
      Returns:
      the array
      Default:
      {}
    • field

      String field
      被校验字段名称
      Returns:
      the string
      Default:
      "field"