Package javax.validation.constraints


package javax.validation.constraints
Contains all the Bean Validation provided constraints also called built-in constraints.

These constraints do not cover all functional use cases but do represent all the fundamental blocks to express low level constraints on basic JDK types.

  • Class
    Description
    The annotated element must be false.
    Defines several AssertFalse annotations on the same element.
    The annotated element must be true.
    Defines several AssertTrue annotations on the same element.
    The annotated element must be a number whose value must be lower or equal to the specified maximum.
    Defines several DecimalMax annotations on the same element.
    The annotated element must be a number whose value must be higher or equal to the specified minimum.
    Defines several DecimalMin annotations on the same element.
    The annotated element must be a number within accepted range Supported types are: BigDecimal BigInteger CharSequence byte, short, int, long, and their respective wrapper types
    Defines several Digits annotations on the same element.
    The string has to be a well-formed email address.
    Defines several @Email constraints on the same element.
    The annotated element must be an instant, date or time in the future.
    Defines several Future annotations on the same element.
    The annotated element must be an instant, date or time in the present or in the future.
    Defines several FutureOrPresent annotations on the same element.
    The annotated element must be a number whose value must be lower or equal to the specified maximum.
    Defines several Max annotations on the same element.
    The annotated element must be a number whose value must be higher or equal to the specified minimum.
    Defines several Min annotations on the same element.
    The annotated element must be a strictly negative number (i.e.
    Defines several Negative constraints on the same element.
    The annotated element must be a negative number or 0.
    Defines several NegativeOrZero constraints on the same element.
    The annotated element must not be null and must contain at least one non-whitespace character.
    Defines several @NotBlank constraints on the same element.
    The annotated element must not be null nor empty.
    Defines several @NotEmpty constraints on the same element.
    The annotated element must not be null.
    Defines several NotNull annotations on the same element.
    The annotated element must be null.
    Defines several Null annotations on the same element.
    The annotated element must be an instant, date or time in the past.
    Defines several Past annotations on the same element.
    The annotated element must be an instant, date or time in the past or in the present.
    Defines several PastOrPresent annotations on the same element.
    The annotated CharSequence must match the specified regular expression.
    Possible Regexp flags.
    Defines several Pattern annotations on the same element.
    The annotated element must be a strictly positive number (i.e.
    Defines several Positive constraints on the same element.
    The annotated element must be a positive number or 0.
    Defines several PositiveOrZero constraints on the same element.
    The annotated element size must be between the specified boundaries (included).
    Defines several Size annotations on the same element.