October 2018
Intermediate to advanced
590 pages
15h 5m
English
Now, let's move on to create the RegistrationPayload class itself. Here is how it looks:
...public class RegistrationPayload { @Size(min = 2, max = 50, message = "Username must be between 2 and 50 characters") @NotNull private String username; @Email(message = "Email address should be valid") @Size(max = 100, message = "Email address must not be more than 100 characters") @NotNull private String emailAddress; @Size(min = 6, max = 30, message = "Password must be between 6 and 30 characters") @NotNull private String password; // getters and setters}
As you can see, this RegistrationPayload class has three fields and the constraints we apply to them match those we added on the frontend. One difference is that the ...
Read now
Unlock full access