批注接口 ValidErrorCode


@Target(TYPE) @Retention(SOURCE) public @interface ValidErrorCode
Custom annotation for marking enums that need error code validation. This annotation is used to configure how error codes within an enum should be validated.
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    Specifies the name of the field within the enum constant that holds the error code.
    int[]
    An array of integer values that will skip validation.
    int
    Configurable total length for the error code (in digits).
    Configurable prefix for the error code.
  • 元素详细资料

    • prefix

      String prefix
      Configurable prefix for the error code. The default value is "1122".
      返回:
      The prefix for the error code.
      默认值:
      "1122"
    • length

      int length
      Configurable total length for the error code (in digits). The default value is 8 digits.
      返回:
      The total length of the error code.
      默认值:
      8
    • codeField

      String codeField
      Specifies the name of the field within the enum constant that holds the error code. The default value is "code".
      返回:
      The name of the error code field.
      默认值:
      "code"
    • excludeValues

      int[] excludeValues
      An array of integer values that will skip validation. By default, it excludes 0 (which usually represents success or OK).
      返回:
      An array of values to exclude from validation.
      默认值:
      {0}