Top Description Annotations
[default module]

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.

Annotation Summary

Modifier and TypeAnnotation and Description
public @interface
AssertFalse

The annotated element must be false.

public @interface
AssertTrue

The annotated element must be true.

public @interface
DecimalMax

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

public @interface
DecimalMin

The annotated element must be a number whose value must be higher or equal to the specified minimum.

public @interface
Digits

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
public @interface
Email

The string has to be a well-formed email address.

public @interface
Future

The annotated element must be an instant, date or time in the future.

public @interface
FutureOrPresent

The annotated element must be an instant, date or time in the present or in the future.

public @interface
Max

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

public @interface
Min

The annotated element must be a number whose value must be higher or equal to the specified minimum.

public @interface
Negative

The annotated element must be a strictly negative number (i.e. 0 is considered as an invalid value).

public @interface
NegativeOrZero

The annotated element must be a negative number or 0.

public @interface
NotBlank

The annotated element must not be null and must contain at least one non-whitespace character.

public @interface
NotEmpty

The annotated element must not be null nor empty.

public @interface
NotNull

The annotated element must not be null.

public @interface
Null

The annotated element must be null.

public @interface
Past

The annotated element must be an instant, date or time in the past.

public @interface
PastOrPresent

The annotated element must be an instant, date or time in the past or in the present.

public @interface
Pattern

The annotated CharSequence must match the specified regular expression.

public @interface
Positive

The annotated element must be a strictly positive number (i.e. 0 is considered as an invalid value).

public @interface
PositiveOrZero

The annotated element must be a positive number or 0.

public @interface
Size

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