37 lines
700 B
Java
37 lines
700 B
Java
package net.hypki.mailclient.model;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class User extends ModelObject {
|
|
private String email = null;
|
|
|
|
private String name = null;
|
|
|
|
public User() {
|
|
|
|
}
|
|
|
|
@Override
|
|
public void validate() throws IOException, IllegalArgumentException {
|
|
// if `to` mail is incorrect then throw exception
|
|
if (!email.contains("@"))
|
|
throw new IOException("bbbbbb");
|
|
}
|
|
|
|
public String getEmail() {
|
|
return email;
|
|
}
|
|
|
|
public void setEmail(String email) {
|
|
this.email = email;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
}
|