Annotation Interface Validation.Collection.Size

Enclosing class:
Validation.Collection

@Target({METHOD,PARAMETER,ANNOTATION_TYPE,TYPE_USE,RECORD_COMPONENT}) @Constraint public static @interface Validation.Collection.Size
Supported for Collection, Map, and arrays.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Message to return instead of the default one of the validator.
    int
    Minimal size of the collection.
    int
    Maximal size of the collection.
  • Element Details

    • message

      String message
      Message to return instead of the default one of the validator. The message can be a string format, where the first (and only) parameter will be the actual value that is being validated.
      Returns:
      message to describe the constraint validation error
      Default:
      ""
    • min

      int min
      Minimal size of the collection. Defaults to zero.
      Returns:
      min length
      Default:
      0
    • value

      int value
      Maximal size of the collection. Defaults to maximal integer value.
      Returns:
      max length
      Default:
      2147483647