Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.validation.constraints.NotNull;
- import javax.validation.constraints.NotEmpty;
- import javax.validation.constraints.Email;
- import javax.validation.constraints.Size;
- public class User {
- @NotNull(message = "Id must be not null")
- private Long id;
- @Email(message = "Email must be valid")
- @NotEmpty(message = "Email must be not null/empty")
- private String email;
- @Size(min = 8, message = "Password must be of min 8 characters")
- @NotEmpty(message = "Password must be not null/empty")
- private String password;
- // Constructor, Setters and Getters
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement