Annotation Interface IntRange


判断数字在int范围内

默认被校验对象是null时,通过校验

Since:
Java 17+
Author:
Kimi Liu
  • Optional Element Summary

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

    • min

      @Filler("min") int min
      小于等于
      Returns:
      the int
      Default:
      -2147483648
    • max

      @Filler("max") int max
      大于等于
      Returns:
      the int
      Default:
      2147483647
    • errcode

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

      String errmsg
      默认使用的异常信息
      Returns:
      the string
      Default:
      "${field}\u5fc5\u987b\u5728\u6307\u5b9a\u8303\u56f4\u5185, \u6700\u5c0f: ${min}, \u6700\u5927: ${max}"
    • group

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

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