javax.validation.constraints

## Annotation Type Size

-     @Target(value={METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER})
      @Retention(value=RUNTIME)
      @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 and Description
    --- | ---
    `Class<?>[]` | `groups`
    `int` | `max`
    `String` | `message`
    `int` | `min`
    `Class<? extends Payload>[]` | `payload`

- - ### Element Detail

    - #### message

          public abstract String message

      Default:
        "{javax.validation.constraints.Size.message}"

    - #### groups

          public abstract Class<?>[] groups

      Default:
        {}

    - #### payload

          public abstract Class<? extends Payload>[] payload

      Default:
        {}

    - #### min

          public abstract int min

      Returns:
        size the element must be higher or equal to
      Default:
        0

    - #### max

          public abstract int max

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

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.