Annotation Interface Size


The annotated element size must be between the specified boundaries (included).

Supported types are:

  • CharSequence (length of character sequence is evaluated)
  • Collection (collection size is evaluated)
  • Map (map size is evaluated)
  • Array (array length is evaluated)

null elements are considered valid.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Defines several Size annotations on the same element.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
     
    int
     
     
    int
     
    Class<? extends Payload>[]
     
  • Element Details

    • message

      String message
      Default:
      "{jakarta.validation.constraints.Size.message}"
    • groups

      Class<?>[] groups
      Default:
      {}
    • payload

      Class<? extends Payload>[] payload
      Default:
      {}
    • min

      int min
      Returns:
      size the element must be higher or equal to
      Default:
      0
    • max

      int max
      Returns:
      size the element must be lower or equal to
      Default:
      2147483647