public void setPassword(String password) { if (password == null) { return; } if (!Validation.isValidPassword(password)) { throw new IllegalArgumentException("Password must be atleast 6 characters long"); } this.password = password; }
public void setEmail(String email) { if (!Validation.isValidEmail(email)) { throw new IllegalArgumentException("Not a valid Email"); } this.email = email; }