Annotation Type Size


  • @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
    @Retention(RUNTIME)
    @Repeatable(List.class)
    @Documented
    @Constraint(validatedBy={})
    public @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.

    Author:
    Emmanuel Bernard
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<?>[] groups  
      int max  
      java.lang.String message  
      int min  
      java.lang.Class<? extends Payload>[] payload  
    • Element Detail

      • message

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

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

        java.lang.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