Annotation Type Size


@Retention(CLASS) @Target({FIELD,PARAMETER}) public @interface Size
The length of a CharSequence, or the size of a collection, map or array, must lie between min() and max(), inclusive. Null is valid; add NotNull to refuse it.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    The largest size allowed.
    The message reported for the field; empty for the default.
    int
    The smallest size allowed.
  • Element Details

    • min

      int min
      The smallest size allowed.
      Default:
      0
    • max

      int max
      The largest size allowed.
      Default:
      2147483647
    • message

      String message
      The message reported for the field; empty for the default.
      Default:
      ""