April 2018
Intermediate to advanced
382 pages
10h 11m
English
Let's check each declared constraint:
@NotBlank (message = "Name should not be blank") @Size (min = 4, max = 10,message = "Name should be between 4 and 10 characters") private String name;
The @NotBlank annotation will deny not only null values, but also white spaces values, and @Size speaks for itself:
@Email (message = "Invalid e-mail format") @NotBlank (message = "E-mail shoud not be blank") private String email;
The @Email constraint will check the email string format:
@PastOrPresent (message = "Created date should be past or present") @NotNull (message = "Create date should not be null") private LocalDate created;
@PastOrPresent will constrain LocalDate to be in the past or until the present date. It can't be in the ...
Read now
Unlock full access