Check out example codes for "how to fix javax.validation.constraints.Email". It will help you in understanding the concepts better.

Code Example 1

@Data
@JsonInclude( JsonInclude.Include.NON_NULL )
public class LocationAccountVO
{
private UUID locationId;
    @NotEmpty(message = "Email is mandatory.")
    @Pattern(regexp = "^[A-Z0-9._%+-][email protected][A-Z0-9.-]+\\.[A-Z]{2,6}$", message = "Email be valid")
    private String email;
}

Learn ReactJs, React Native from akashmittal.com