1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
import java.io.*;
import java.io.Serializable;
public class User implements Serializable
{
private static final long serialVersionUID = 1L;
private int id;
private String nom;
private String prenom;
private String mail;
private String telephone;
public User () {
this.id = 0;
this.nom = "";
this.prenom = "";
this.mail = "";
this.telephone = "";
}
public User (String nom, String prenom, String mail, String telephone) {
this.id = addId();
this.nom = nom;
this.prenom = prenom;
this.mail = mail;
this.telephone = telephone;
}
public User (User user) {
this.nom = user.getNom();
this.prenom = user.getPrenom();
this.mail = user.getMail();
this.telephone = user.getTelephone();
}
public void setId(int id) {
this.id = id;
}
public int getId() {
return this.id;
}
public void setNom(String nom){
this.nom = nom;
}
public String getNom(){
return this.nom;
}
public void setPrenom(String prenom){
this.prenom = prenom;
}
public String getPrenom(){
return this.prenom;
}
public void setMail(String mail){
this.mail = mail;
}
public String getMail(){
return this.mail;
}
public void setTelephone(String telephone){
this.telephone = telephone;
}
public String getTelephone(){
return telephone;
}
private int addId(){
return id = id + 1;
}
} |
Partager