Annotation Interface Max


The annotated element must be a number whose value must be lower or equal to the specified maximum.

Supported types are:

  • BigDecimal
  • BigInteger
  • byte, short, int, long, and their respective wrappers
Note that double and float are not supported due to rounding errors (some providers might provide some approximative support).

null elements are considered valid.

  • Nested Class Summary

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

    Required Elements
    Modifier and Type
    Required Element
    Description
    long
     
  • Optional Element Summary

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

    • value

      long value
      Returns:
      value the element must be lower or equal to
    • message

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

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

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