Annotation Type Email


@Target(FIELD) @Retention(RUNTIME) public @interface Email
Annotation used to validate whether a string represents a valid email address.

This annotation applies a standardized email regex pattern during validation.

For custom or stricter email formats, consider using the Pattern annotation instead. * Example usage: *

  * 
  * public class UserDto {
  *     @Email
  *     private String email;
  * }
  * 
  * 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • message

      String message
      Default:
      "Field value must fit the email pattern!"