> For the complete documentation index, see [llms.txt](https://bernardo.gitbook.io/development-docs-java/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bernardo.gitbook.io/development-docs-java/java-bean-validation/annotations.md).

# Annotations

Beans can be annotated to indicate validations. They are set to fields. and these are some of the most common ones:

* AssertTrue
* Max
* Min
* NotNull

## Usage

```java
public class ValidatedClass {

   @NotNull
   private String field;

}
```

Applying validation groups:

```java
public class ValidatedClass {

   @NotNull(groups = { UpdateValidationGroup.class, CreateValidationGroup.class })
   private String field;

}
```

The groups can be any class or interface.
